T
- type of object kept by this referencepublic class MutableRef<T> extends java.lang.Object implements IReference<T>
NULL_REF
Constructor and Description |
---|
MutableRef()
Constructor creating a
null reference |
MutableRef(T reference)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
T |
get()
Get the referenced object.
|
T |
require()
Require that the reference value is set to a non-null value.
|
void |
set(T reference)
Set the reference.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hard, nullRef, soft, weak
public void set(@Nullable T reference)
reference
- referenced object@Nullable public T get()
IReference
null
if the referenced
object is garbage collected or this is a null reference
.get
in interface IReference<T>
null