T
- the value typepublic final class Timed<T> extends Object
Constructor and Description |
---|
Timed(T value,
long time,
TimeUnit unit)
Constructs a Timed instance with the given value and time information.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
int |
hashCode() |
long |
time()
Returns the time value.
|
long |
time(TimeUnit unit)
Returns the contained time value in the time unit specified.
|
String |
toString() |
TimeUnit |
unit()
Returns the time unit of the contained time.
|
T |
value()
Returns the contained value.
|
public Timed(@NonNull T value, long time, @NonNull TimeUnit unit)
value
- the value to holdtime
- the time to holdunit
- the time unit, not nullNullPointerException
- if unit is null@NonNull public TimeUnit unit()
public long time()
public long time(@NonNull TimeUnit unit)
unit
- the time unt