Constructor and Description |
---|
Reference()
Create a new Reference with a null value.
|
Reference(T value)
Create a new Reference to the given value object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
clear()
Sets this references value field to null.
|
T |
get()
Retrieves this references value object.
|
T |
getAndSet(T value)
Replaces this references value with the given one.
|
T |
getNonnull()
Retrieves the non null value stored by this var
|
boolean |
isSet() |
boolean |
set(T value)
Sets this references value object to the given instance.
|
public final boolean clear()
public final boolean set(@Nullable T value)
value
- the value@Nonnull public final T getNonnull()
IllegalStateException
- value is nullpublic final T getAndSet(T value)
value
- the new valuepublic final boolean isSet()