public class Pointer<T>
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Pointer()
Create a pointer pointing nowhere.
|
Pointer(T impl)
Create a pointer pointing at the given object.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<T> |
dereference()
Dereference the pointer.
|
void |
set(java.util.Optional<T> impl)
Set the pointer to a possible value.
|
void |
set(T impl)
Set the pointer.
|
public Pointer()
public Pointer(T impl)
impl
- The object the pointer is pointing at.public java.util.Optional<T> dereference()
public void set(T impl)
impl
- The value to set the pointer to. If this is null, the pointer is unset.public void set(java.util.Optional<T> impl)
impl
- The value to set the pointer to. If this is empty, the pointer is unset.