![JAR search and dependency download from the Maven repository](/logo.png)
org.opensearch.migrations.replay.traffic.expiration.EpochMillis Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of trafficReplayer Show documentation
Show all versions of trafficReplayer Show documentation
Everything opensearch migrations
package org.opensearch.migrations.replay.traffic.expiration;
import java.time.Instant;
import java.util.function.BiPredicate;
import lombok.EqualsAndHashCode;
@EqualsAndHashCode
class EpochMillis implements Comparable {
final long millis;
public EpochMillis(Instant i) {
millis = i.toEpochMilli();
}
public EpochMillis(long ms) {
this.millis = ms;
}
public boolean test(EpochMillis referenceTimestamp, BiPredicate c) {
return c.test(this.millis, referenceTimestamp.millis);
}
public boolean test(Instant referenceTimestamp, BiPredicate c) {
return c.test(this.millis, referenceTimestamp.toEpochMilli());
}
public Instant toInstant() {
return Instant.ofEpochMilli(millis);
}
@Override
public String toString() {
return Long.toString(millis);
}
@Override
public int compareTo(EpochMillis o) {
return Long.compare(this.millis, o.millis);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy