public class SoftThreadLocal<T> extends ThreadLocal<SoftReference<T>>
Modifier and Type | Field and Description |
---|---|
protected Function<? super T,? extends T> |
onGet |
protected Supplier<T> |
supplier |
Constructor and Description |
---|
SoftThreadLocal(Supplier<T> supplier) |
SoftThreadLocal(Supplier<T> supplier,
Function<? super T,? extends T> onGet) |
Modifier and Type | Method and Description |
---|---|
T |
getValue() |
protected T |
init() |
protected SoftReference<T> |
initialValue() |
void |
setValue(T t) |
get, remove, set, withInitial
protected T init()
public T getValue()
public final void setValue(T t)
protected final SoftReference<T> initialValue()
initialValue
in class ThreadLocal<SoftReference<T>>
Copyright © 2016–2021. All rights reserved.