T - The managed object type.public final class Late<T>
extends java.lang.Object
| Constructor and Description |
|---|
Late() |
| Modifier and Type | Method and Description |
|---|---|
T |
get()
Get the hold object.
|
T |
getIfInitialized()
Get the hold object if it has been initialized.
|
T |
init(T object)
Initialize the hold object.
|
boolean |
isInitialized()
Check whether the hold object has already been initialized (by call to
init(Object)). |
java.lang.String |
toString() |
public T init(T object) throws java.lang.IllegalStateException
object - The object to set.java.lang.IllegalStateException - If the object has already been initialized.public boolean isInitialized()
init(Object)).true if the object has already been initialized.public T get() throws java.lang.IllegalStateException
java.lang.IllegalStateException - if the object has not yet been initialized.@Nullable public T getIfInitialized()
null if it has not yet been initialized.public java.lang.String toString()
toString in class java.lang.Object