T - the wrapped value typepublic final class ExpiringValue<T> extends Object implements TransientValue<T>
| Modifier and Type | Method and Description |
|---|---|
T |
getOrNull()
Returns the underlying value, or null if it has expired
|
static <T> ExpiringValue<T> |
of(T value,
long duration,
TimeUnit unit) |
boolean |
shouldExpire()
Returns if this value should be removed from the map
|
public static <T> ExpiringValue<T> of(T value, long duration, TimeUnit unit)
@Nullable public T getOrNull()
TransientValuegetOrNull in interface TransientValue<T>public boolean shouldExpire()
TransientValueshouldExpire in interface TransientValue<T>Copyright © 2017. All rights reserved.