T - The data value.public class TimedData<T>
extends java.lang.Object
implements tec.uom.lib.common.function.Nameable, java.util.function.Supplier<T>
| Modifier and Type | Field and Description |
|---|---|
private java.time.Instant |
instant |
private java.lang.String |
name |
private long |
timestamp |
private T |
value |
| Modifier | Constructor and Description |
|---|---|
protected |
TimedData(T value,
long time)
Construct an instance of TimedData with a value and timestamp.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
T |
get() |
java.time.Instant |
getInstant() |
java.lang.String |
getName() |
long |
getTimestamp()
Returns the time with which this TimedData was created.
|
int |
hashCode() |
static <T> TimedData<T> |
of(T val,
long time)
Returns an
MeasurementRange with the specified values. |
java.lang.String |
toString() |
private final T value
private final long timestamp
private final java.time.Instant instant
private java.lang.String name
protected TimedData(T value, long time)
data - The value of the TimedData.time - The timestamp of the TimedData.public static <T> TimedData<T> of(T val, long time)
MeasurementRange with the specified values.T - the class of the valueval - The minimum value for the measurement range.time - The maximum value for the measurement range.MeasurementRange with the given valuespublic long getTimestamp()
public java.lang.String getName()
getName in interface tec.uom.lib.common.function.Nameablepublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.time.Instant getInstant()