Skip to content

Commit

Permalink
Added equality/hashcode support
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Apr 14, 2022
1 parent e620bf3 commit ae68048
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/net/fortuna/ical4j/model/TemporalAdapter.java
Expand Up @@ -308,4 +308,17 @@ public static <T extends Temporal> boolean isAfter(T date1, T date2) {
}
return Instant.from(date1).isAfter(Instant.from(date2));
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TemporalAdapter<?> that = (TemporalAdapter<?>) o;
return valueString.equals(that.valueString) && Objects.equals(tzId, that.tzId);
}

@Override
public int hashCode() {
return Objects.hash(valueString, tzId);
}
}

0 comments on commit ae68048

Please sign in to comment.