X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.network.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fui%2Fbreakdown%2FInput.java;fp=org.simantics.district.network.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fui%2Fbreakdown%2FInput.java;h=6d9ae8b67cd39f0e4cdf67ed1173aa0a8a30d0a6;hb=cb2ebef6cbe572f646082952f57bb69135f308bd;hp=dd80c2a657500a8c99fc141eec7738f73a42fcd5;hpb=e67c653b710b4f752acaeae332a29616bfc6e408;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/breakdown/Input.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/breakdown/Input.java index dd80c2a6..6d9ae8b6 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/breakdown/Input.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/breakdown/Input.java @@ -14,9 +14,35 @@ 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; @@ -24,6 +50,37 @@ public class Input { 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 { @@ -38,6 +95,46 @@ public class Input { 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; + } } }