@Test void testGetTokenAtReset() { ReplayToken testSubject = new ReplayToken(innerToken); TrackingToken actual = testSubject.advancedTo(GapAwareTrackingToken.newInstance(6, emptySet())); assertTrue(actual instanceof ReplayToken); assertEquals(testSubject.getTokenAtReset(), innerToken); }
public static OptionalLong getTokenAtReset(TrackingToken trackingToken) { return WrappedToken.unwrap(trackingToken, ReplayToken.class) .map(rt -> rt.getTokenAtReset().position()) .orElse(OptionalLong.empty()); }
ReplayToken implements TrackingToken, WrappedToken, Serializable { public static OptionalLong getTokenAtReset(TrackingToken trackingToken) { return WrappedToken.unwrap(trackingToken, ReplayToken.class) .map(rt -> rt.getTokenAtReset().position()) .orElse(OptionalLong.empty()); } }
ReplayToken implements TrackingToken, WrappedToken, Serializable { public static OptionalLong getTokenAtReset(TrackingToken trackingToken) { return WrappedToken.unwrap(trackingToken, ReplayToken.class) .map(rt -> rt.getTokenAtReset().position()) .orElse(OptionalLong.empty()); } ReplayToken(TrackingToken tokenAtReset); @JsonCreator @ConstructorProperties({"tokenAtReset", "currentToken"})  ReplayToken(@JsonProperty("tokenAtReset") TrackingToken tokenAtReset,
                       @JsonProperty("currentToken") TrackingToken newRedeliveryToken); private  ReplayToken(TrackingToken tokenAtReset,
                       TrackingToken newRedeliveryToken,
                       boolean lastMessageWasReplay); }
ReplayToken implements TrackingToken, WrappedToken, Serializable { public static OptionalLong getTokenAtReset(TrackingToken trackingToken) { return WrappedToken.unwrap(trackingToken, ReplayToken.class) .map(rt -> rt.getTokenAtReset().position()) .orElse(OptionalLong.empty()); } ReplayToken(TrackingToken tokenAtReset); @JsonCreator @ConstructorProperties({"tokenAtReset", "currentToken"})  ReplayToken(@JsonProperty("tokenAtReset") TrackingToken tokenAtReset,
                       @JsonProperty("currentToken") TrackingToken newRedeliveryToken); private  ReplayToken(TrackingToken tokenAtReset,
                       TrackingToken newRedeliveryToken,
                       boolean lastMessageWasReplay); static TrackingToken createReplayToken(TrackingToken tokenAtReset, TrackingToken startPosition); static TrackingToken createReplayToken(TrackingToken tokenAtReset); static boolean isReplay(Message<?> message); static boolean isReplay(TrackingToken trackingToken); static OptionalLong getTokenAtReset(TrackingToken trackingToken); TrackingToken getTokenAtReset(); TrackingToken getCurrentToken(); @Override TrackingToken advancedTo(TrackingToken newToken); @Override TrackingToken lowerBound(TrackingToken other); @Override TrackingToken upperBound(TrackingToken other); @Override boolean covers(TrackingToken other); @Override TrackingToken lowerBound(); @Override TrackingToken upperBound(); @Override Optional<R> unwrap(Class<R> tokenType); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override OptionalLong position(); }
ReplayToken implements TrackingToken, WrappedToken, Serializable { public static OptionalLong getTokenAtReset(TrackingToken trackingToken) { return WrappedToken.unwrap(trackingToken, ReplayToken.class) .map(rt -> rt.getTokenAtReset().position()) .orElse(OptionalLong.empty()); } ReplayToken(TrackingToken tokenAtReset); @JsonCreator @ConstructorProperties({"tokenAtReset", "currentToken"})  ReplayToken(@JsonProperty("tokenAtReset") TrackingToken tokenAtReset,
                       @JsonProperty("currentToken") TrackingToken newRedeliveryToken); private  ReplayToken(TrackingToken tokenAtReset,
                       TrackingToken newRedeliveryToken,
                       boolean lastMessageWasReplay); static TrackingToken createReplayToken(TrackingToken tokenAtReset, TrackingToken startPosition); static TrackingToken createReplayToken(TrackingToken tokenAtReset); static boolean isReplay(Message<?> message); static boolean isReplay(TrackingToken trackingToken); static OptionalLong getTokenAtReset(TrackingToken trackingToken); TrackingToken getTokenAtReset(); TrackingToken getCurrentToken(); @Override TrackingToken advancedTo(TrackingToken newToken); @Override TrackingToken lowerBound(TrackingToken other); @Override TrackingToken upperBound(TrackingToken other); @Override boolean covers(TrackingToken other); @Override TrackingToken lowerBound(); @Override TrackingToken upperBound(); @Override Optional<R> unwrap(Class<R> tokenType); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); @Override OptionalLong position();  }