@Test void equals() { Map<String, TrackingToken> tokenMap = new HashMap<>(); tokenMap.put("token1", new GlobalSequenceTrackingToken(0)); tokenMap.put("token2", new GlobalSequenceTrackingToken(0)); MultiSourceTrackingToken newMultiToken = new MultiSourceTrackingToken(tokenMap); assertEquals(newMultiToken, testSubject); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MultiSourceTrackingToken that = (MultiSourceTrackingToken) o; if (this.trackingTokens.size() != that.trackingTokens.size()) { return false; } return trackingTokens.entrySet() .stream() .allMatch(trackingTokenEntry -> Objects.equals(trackingTokenEntry.getValue(), that.trackingTokens.get(trackingTokenEntry.getKey()))); }
MultiSourceTrackingToken implements TrackingToken, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MultiSourceTrackingToken that = (MultiSourceTrackingToken) o; if (this.trackingTokens.size() != that.trackingTokens.size()) { return false; } return trackingTokens.entrySet() .stream() .allMatch(trackingTokenEntry -> Objects.equals(trackingTokenEntry.getValue(), that.trackingTokens.get(trackingTokenEntry.getKey()))); } }
MultiSourceTrackingToken implements TrackingToken, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MultiSourceTrackingToken that = (MultiSourceTrackingToken) o; if (this.trackingTokens.size() != that.trackingTokens.size()) { return false; } return trackingTokens.entrySet() .stream() .allMatch(trackingTokenEntry -> Objects.equals(trackingTokenEntry.getValue(), that.trackingTokens.get(trackingTokenEntry.getKey()))); } @JsonCreator @ConstructorProperties({"trackingTokens"})  MultiSourceTrackingToken(@JsonProperty("trackingTokens") Map<String, TrackingToken> trackingTokens); }
MultiSourceTrackingToken implements TrackingToken, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MultiSourceTrackingToken that = (MultiSourceTrackingToken) o; if (this.trackingTokens.size() != that.trackingTokens.size()) { return false; } return trackingTokens.entrySet() .stream() .allMatch(trackingTokenEntry -> Objects.equals(trackingTokenEntry.getValue(), that.trackingTokens.get(trackingTokenEntry.getKey()))); } @JsonCreator @ConstructorProperties({"trackingTokens"})  MultiSourceTrackingToken(@JsonProperty("trackingTokens") Map<String, TrackingToken> trackingTokens); @Override TrackingToken lowerBound(TrackingToken other); @Override TrackingToken upperBound(TrackingToken other); @Override boolean covers(TrackingToken other); MultiSourceTrackingToken advancedTo(String streamName, TrackingToken newTokenForStream); TrackingToken getTokenForStream(String streamName); Map<String, TrackingToken> getTrackingTokens(); @Override OptionalLong position(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
MultiSourceTrackingToken implements TrackingToken, Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } MultiSourceTrackingToken that = (MultiSourceTrackingToken) o; if (this.trackingTokens.size() != that.trackingTokens.size()) { return false; } return trackingTokens.entrySet() .stream() .allMatch(trackingTokenEntry -> Objects.equals(trackingTokenEntry.getValue(), that.trackingTokens.get(trackingTokenEntry.getKey()))); } @JsonCreator @ConstructorProperties({"trackingTokens"})  MultiSourceTrackingToken(@JsonProperty("trackingTokens") Map<String, TrackingToken> trackingTokens); @Override TrackingToken lowerBound(TrackingToken other); @Override TrackingToken upperBound(TrackingToken other); @Override boolean covers(TrackingToken other); MultiSourceTrackingToken advancedTo(String streamName, TrackingToken newTokenForStream); TrackingToken getTokenForStream(String streamName); Map<String, TrackingToken> getTrackingTokens(); @Override OptionalLong position(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }