Skip to content

Commit

Permalink
refactor: update equals() and hashCode methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jungwire committed May 10, 2024
1 parent a6cc19c commit 995b4e3
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,16 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Network that = (Network) o;
return Objects.equals(externalId, that.externalId);
return Objects.equals(externalId, that.externalId)
&& Objects.equals(id, that.id)
&& Objects.equals(uri, that.uri)
&& Objects.equals(name, that.name)
&& Objects.equals(contactEmail, that.contactEmail);
}

@Override
public int hashCode() {
return Objects.hash(externalId);
return Objects.hash(externalId, id, uri, name, contactEmail);
}

/** Adds a resource to the network. */
Expand Down

0 comments on commit 995b4e3

Please sign in to comment.