Skip to content

Commit

Permalink
Need to override hashCode and toString as well
Browse files Browse the repository at this point in the history
  • Loading branch information
basiliskus committed Dec 23, 2024
1 parent 12ee956 commit c157395
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ public boolean equals(Object o) {
return (Objects.equals(segmentName, hl7Path.segmentName))
&& Arrays.equals(indices, hl7Path.indices);
}

@Override
public int hashCode() {
return Objects.hash(segmentName, Arrays.hashCode(indices));
}

@Override
public String toString() {
return "HL7Path[segmentName=" + segmentName + ", indices=" + Arrays.toString(indices) + "]";
}
}

0 comments on commit c157395

Please sign in to comment.