- java.lang.Object
-
- org.refcodes.struct.Referencee<T>
-
- Type Parameters:
T
- The type of the referencee to be encapsulated by thisReferencee
.
public class Referencee<T> extends Object
AReferencee
encapsulates a reference to an instance which might be null at the time of the referencee's creation. This way a reference to a non yet existing object can be provided.
-
-
Constructor Summary
Constructors Constructor Description Referencee()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getReference()
Retrieves the according reference.T
referTo(T aReference)
Sets the according reference and returns the reference being set.void
setReference(T aReference)
Sets the according reference.
-
-
-
Method Detail
-
getReference
public T getReference()
Retrieves the according reference.- Returns:
- The according reference.
-
setReference
public void setReference(T aReference)
Sets the according reference.- Parameters:
aReference
- The according reference.
-
referTo
public T referTo(T aReference)
Sets the according reference and returns the reference being set. With this method, aReferencee
can be introduced in places where the actual reference is being created and expected.- Parameters:
aReference
- The according reference to be set.- Returns:
- The reference being set.
-
-