package org.simantics.district.network.ui.breakdown; import java.util.ArrayList; import java.util.List; import org.simantics.databoard.util.Bean; import org.simantics.db.Resource; /** * @author Tuukka Lehtonen * @since 1.35.0 */ public class Input { public static class NetworkDiagrams extends Bean { public List diagrams = new ArrayList<>(); @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((diagrams == null) ? 0 : diagrams.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; NetworkDiagrams other = (NetworkDiagrams) obj; if (diagrams == null) { if (other.diagrams != null) return false; } else if (!diagrams.equals(other.diagrams)) return false; return true; } } public static class NetworkDiagram extends Bean { public String name; public Resource diagram; public NetworkDiagram(String name, Resource diagram) { this.name = name; this.diagram = diagram; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((diagram == null) ? 0 : diagram.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; NetworkDiagram other = (NetworkDiagram) obj; if (diagram == null) { if (other.diagram != null) return false; } else if (!diagram.equals(other.diagram)) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; return true; } } public static class Subgraph { public NetworkDiagram parent; public int index; public List vertices; public List edges; public Subgraph(NetworkDiagram parent, int index, List vertices, List edges) { this.parent = parent; this.index = index; this.vertices = vertices; this.edges = edges; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((edges == null) ? 0 : edges.hashCode()); result = prime * result + index; result = prime * result + ((parent == null) ? 0 : parent.hashCode()); result = prime * result + ((vertices == null) ? 0 : vertices.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Subgraph other = (Subgraph) obj; if (edges == null) { if (other.edges != null) return false; } else if (!edges.equals(other.edges)) return false; if (index != other.index) return false; if (parent == null) { if (other.parent != null) return false; } else if (!parent.equals(other.parent)) return false; if (vertices == null) { if (other.vertices != null) return false; } else if (!vertices.equals(other.vertices)) return false; return true; } } }