Skip to content
This repository was archived by the owner on May 28, 2024. It is now read-only.

Commit 1bd5b68

Browse files
committed
Restored issn equality
1 parent 5da9a6d commit 1bd5b68

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

  • src/main/java/org/cdlib/domain/objects/bib

src/main/java/org/cdlib/domain/objects/bib/ISSN.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,36 @@ public String toString() {
6464
return JSON.serialize(this);
6565
}
6666

67+
@Override
68+
public int hashCode() {
69+
final int prime = 31;
70+
int result = 1;
71+
result = prime * result + ((alternateValues == null) ? 0 : alternateValues.hashCode());
72+
result = prime * result + ((value == null) ? 0 : value.hashCode());
73+
return result;
74+
}
75+
76+
@Override
77+
public boolean equals(Object obj) {
78+
if (this == obj)
79+
return true;
80+
if (obj == null)
81+
return false;
82+
if (getClass() != obj.getClass())
83+
return false;
84+
ISSN other = (ISSN) obj;
85+
if (alternateValues == null) {
86+
if (other.alternateValues != null)
87+
return false;
88+
} else if (!alternateValues.equals(other.alternateValues))
89+
return false;
90+
if (value == null) {
91+
if (other.value != null)
92+
return false;
93+
} else if (!value.equals(other.value))
94+
return false;
95+
return true;
96+
}
97+
6798

6899
}

0 commit comments

Comments
 (0)