Skip to content

Commit

Permalink
adding equals to enable caching in OBA
Browse files Browse the repository at this point in the history
  • Loading branch information
sheldonabrown committed Jan 13, 2024
1 parent 1467be9 commit c77f0f1
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ private Date startOfDay(ServiceDate serviceDate) {
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 000);
return cal.getTime();
}

@Override
public boolean equals(Object other) {
if (!(other instanceof AgencyServiceInterval)) {
return false;
}
AgencyServiceInterval that = (AgencyServiceInterval) other;
return that._referenceTime == _referenceTime;
}

@Override
public int hashCode() {
return new Long(_referenceTime).hashCode();
}
}

0 comments on commit c77f0f1

Please sign in to comment.