T - the contained typepublic final class Timestamped<T> extends java.lang.Object implements java.lang.Comparable<Timestamped<T>>
| Constructor and Description |
|---|
Timestamped(T value,
long timestamp)
Construct a new timestamped value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Timestamped<T> that) |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
static <T> Timestamped<T> |
of(T value)
A type inference helper to construct a new timestamped value where the timestamp
is the System.currentTimeMillis().
|
static <T> Timestamped<T> |
of(Timestamped<T> value)
A type inference helper to construct a new timestamped value from another timestamped value
where the new timestamp is the System.currentTimeMillis().
|
static <T> Timestamped<T> |
of(Timestamped<T> value,
long timestamp)
A type inference helper to construct a new timestamped value from another
timestamped value by keeping the value and assigning a new value.
|
static <T> Timestamped<T> |
of(T value,
long timestamp)
A type inference helper to construct a new timestamped value.
|
long |
timestamp() |
java.lang.String |
toString() |
T |
value() |
public Timestamped(T value, long timestamp)
value - the valuetimestamp - the timestamppublic T value()
public long timestamp()
@Nonnull public static <T> Timestamped<T> of(T value, long timestamp)
T - the type of the valuevalue - the valuetimestamp - the timestamp@Nonnull public static <T> Timestamped<T> of(@Nonnull Timestamped<T> value, long timestamp)
T - the type of the valuevalue - the valuetimestamp - the timestamp@Nonnull public static <T> Timestamped<T> of(T value)
T - the type of the valuevalue - the valuepublic static <T> Timestamped<T> of(@Nonnull Timestamped<T> value)
T - the type of the valuevalue - the valuepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(Timestamped<T> that)
compareTo in interface java.lang.Comparable<Timestamped<T>>