Package org.jboss.weld.util
Class LazyValueHolder<T>
- java.lang.Object
-
- org.jboss.weld.util.LazyValueHolder<T>
-
- All Implemented Interfaces:
ValueHolder<T>
- Direct Known Subclasses:
LazyValueHolder.Serializable
,TypeClosureLazyValueHolder
public abstract class LazyValueHolder<T> extends Object implements ValueHolder<T>
Represents a lazily computed value.- Author:
- Stuart Douglas
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LazyValueHolder.Serializable<T>
LazyValueHolder
that implementsSerializable
.
-
Constructor Summary
Constructors Constructor Description LazyValueHolder()
-
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> LazyValueHolder<T>
forSupplier(Supplier<T> supplier)
T
get()
T
getIfPresent()
boolean
isAvailable()
-
-
-
Method Detail
-
forSupplier
public static <T> LazyValueHolder<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()
-
isAvailable
public boolean isAvailable()
-
computeValue
protected abstract T computeValue()
-
-