- 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
AReferenceeencapsulates 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 TgetReference()Retrieves the according reference.TreferTo(T aReference)Sets the according reference and returns the reference being set.voidsetReference(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, aReferenceecan 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.
-
-