Changeset 9371 in josm for trunk/src/org/openstreetmap/josm/data/osm/RelationToChildReference.java
- Timestamp:
- 2016-01-09T23:20:37+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/RelationToChildReference.java
r9067 r9371 4 4 import java.util.Collection; 5 5 import java.util.HashSet; 6 import java.util.Objects; 6 7 import java.util.Set; 7 8 … … 78 79 79 80 @Override 80 public int hashCode() {81 final int prime = 31;82 i nt result = 1;83 result = prime * result + ((child == null) ? 0 : child.hashCode());84 re sult = prime * result + ((parent == null) ? 0 : parent.hashCode());85 result = prime * result + position;86 result = prime * result + ((role == null) ? 0 : role.hashCode());87 return result;81 public boolean equals(Object obj) { 82 if (this == obj) return true; 83 if (obj == null || getClass() != obj.getClass()) return false; 84 RelationToChildReference that = (RelationToChildReference) obj; 85 return position == that.position && 86 Objects.equals(parent, that.parent) && 87 Objects.equals(role, that.role) && 88 Objects.equals(child, that.child); 88 89 } 89 90 90 91 @Override 91 public boolean equals(Object obj) { 92 if (this == obj) 93 return true; 94 if (obj == null) 95 return false; 96 if (getClass() != obj.getClass()) 97 return false; 98 RelationToChildReference other = (RelationToChildReference) obj; 99 if (child == null) { 100 if (other.child != null) 101 return false; 102 } else if (!child.equals(other.child)) 103 return false; 104 if (parent == null) { 105 if (other.parent != null) 106 return false; 107 } else if (!parent.equals(other.parent)) 108 return false; 109 if (position != other.position) 110 return false; 111 if (role == null) { 112 if (other.role != null) 113 return false; 114 } else if (!role.equals(other.role)) 115 return false; 116 return true; 92 public int hashCode() { 93 return Objects.hash(parent, position, role, child); 117 94 } 118 95 }
Note:
See TracChangeset
for help on using the changeset viewer.