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