Package org.jboss.weld.util
Class WeakLazyValueHolder<T>
- java.lang.Object
-
- org.jboss.weld.util.WeakLazyValueHolder<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
ValueHolder<T>
public abstract class WeakLazyValueHolder<T> extends Object implements ValueHolder<T>
LazyValueHolder
that usesWeakReference
.- Author:
- Jozef Hartinger
-
-
Constructor Summary
Constructors Constructor Description WeakLazyValueHolder()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clear()
protected abstract T
computeValue()
static <T> WeakLazyValueHolder<T>
forSupplier(Supplier<T> supplier)
T
get()
T
getIfPresent()
-
-
-
Method Detail
-
forSupplier
public static <T> WeakLazyValueHolder<T> forSupplier(Supplier<T> supplier)
-
get
public T get()
- Specified by:
get
in interfaceValueHolder<T>
-
getIfPresent
public T getIfPresent()
- Specified by:
getIfPresent
in interfaceValueHolder<T>
-
clear
public void clear()
-
computeValue
protected abstract T computeValue()
-
-