T - The type to create
Usage:
private final Lazy<Object> lazyObject = new Lazy<>(Object::new);
public final class Lazy<T> extends AbstractSynchronousLazy<T>
A default implementation of AbstractSynchronousLazy<T>
| Constructor and Description |
|---|
Lazy(java.util.concurrent.Callable<T> initialization) |
| Modifier and Type | Method and Description |
|---|---|
protected T |
create()
The creation function.
|
getObject, isCreatedpublic Lazy(java.util.concurrent.Callable<T> initialization)
protected final T create() throws java.lang.Exception
AbstractSynchronousLazyThe creation function. This function will only be called once. If the implementation gives an error, that error will be retained and rethrown.
create in class AbstractSynchronousLazy<T>java.lang.Exception