Revision d9b27602
Added by Patrick Plitzner almost 6 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dto/SpecimenNodeWrapper.java | ||
---|---|---|
36 | 36 |
return taxonNode; |
37 | 37 |
} |
38 | 38 |
|
39 |
@Override |
|
40 |
public int hashCode() { |
|
41 |
final int prime = 31; |
|
42 |
int result = 1; |
|
43 |
result = prime * result + ((taxonNode == null) ? 0 : taxonNode.hashCode()); |
|
44 |
result = prime * result + ((uuidAndTitleCache == null) ? 0 : uuidAndTitleCache.getUuid().hashCode()); |
|
45 |
return result; |
|
46 |
} |
|
47 |
|
|
48 |
@Override |
|
49 |
public boolean equals(Object obj) { |
|
50 |
if (this == obj) { |
|
51 |
return true; |
|
52 |
} |
|
53 |
if (obj == null) { |
|
54 |
return false; |
|
55 |
} |
|
56 |
if (getClass() != obj.getClass()) { |
|
57 |
return false; |
|
58 |
} |
|
59 |
SpecimenNodeWrapper other = (SpecimenNodeWrapper) obj; |
|
60 |
if (taxonNode == null) { |
|
61 |
if (other.taxonNode != null) { |
|
62 |
return false; |
|
63 |
} |
|
64 |
} else if (!taxonNode.equals(other.taxonNode)) { |
|
65 |
return false; |
|
66 |
} |
|
67 |
if (uuidAndTitleCache == null) { |
|
68 |
if (other.uuidAndTitleCache != null) { |
|
69 |
return false; |
|
70 |
} |
|
71 |
} else if (!uuidAndTitleCache.getUuid().equals(other.uuidAndTitleCache.getUuid())) { |
|
72 |
return false; |
|
73 |
} |
|
74 |
return true; |
|
75 |
} |
|
76 |
|
|
77 |
|
|
78 |
|
|
39 | 79 |
} |
Also available in: Unified diff
ref #7095 Retrieve only distinct SpecimenNodeWrapper objects