T - The managed object type.public final class Lazy<T>
extends java.lang.Object
| Constructor and Description |
|---|
Lazy(java.util.function.Supplier<T> initializer)
Construct
Lazy. |
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Get the hold object.
|
boolean |
isInitialized()
Check whether the hold object has already been initialized (by a call to
get()). |
java.lang.String |
toString() |
public Lazy(java.util.function.Supplier<T> initializer)
Lazy.initializer - The Supplier to use for object initialization.public boolean isInitialized()
get()).true if the object has already been initialized.public T get()
The object will be initialized the first time this function is invoked.
public java.lang.String toString()
toString in class java.lang.Object