Skip to content

Commit

Permalink
Merge pull request #13 from SonamChugh13/sonam
Browse files Browse the repository at this point in the history
Issue #1: Override method hashCode() because class overrides equals()…
  • Loading branch information
Sriluharshini authored Feb 14, 2024
2 parents c0549f8 + fb3a565 commit 56a96d1
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,14 @@ public boolean equals(Object o) {
return toString().equals(o.toString());
}

@Override
public int hashCode() {
final int primeNumber = 31;
int result = 1;
result = result * primeNumber + (startTime == null ? 0 : startTime.hashCode());
return result;
}

@NonNull
@Override
public String toString() {
Expand Down

0 comments on commit 56a96d1

Please sign in to comment.