T - the wrapped value typepublic class ExpireAfterAccessValue<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> ExpireAfterAccessValue<T> |
of(T value,
long duration,
TimeUnit unit) |
boolean |
shouldExpire()
Returns if this value should be removed from the map
|
static <T> Supplier<ExpireAfterAccessValue<T>> |
supplied(Supplier<? extends T> supplier,
long duration,
TimeUnit unit) |
public static <T> ExpireAfterAccessValue<T> of(T value, long duration, TimeUnit unit)
public static <T> Supplier<ExpireAfterAccessValue<T>> supplied(Supplier<? extends T> supplier, long duration, TimeUnit unit)
@Nullable public T getOrNull()
TransientValuegetOrNull in interface TransientValue<T>public boolean shouldExpire()
TransientValueshouldExpire in interface TransientValue<T>Copyright © 2020. All rights reserved.