Package org.jgroups.util
Class ImmutableReference<T>
- java.lang.Object
-
- org.jgroups.util.ImmutableReference<T>
-
public class ImmutableReference<T> extends java.lang.Object
Simple class that holds an immutable reference to another object (or tonull
).- Author:
- Brian Stansberry
-
-
Constructor Summary
Constructors Constructor Description ImmutableReference(T referent)
Create a new ImmutableReference.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
Gets the wrapped object, if there is one.
-
-
-
Constructor Detail
-
ImmutableReference
public ImmutableReference(T referent)
Create a new ImmutableReference.- Parameters:
referent
- the object to refer to, ornull
-
-
Method Detail
-
get
public T get()
Gets the wrapped object, if there is one.- Returns:
- the object passed to the constructor, or
null
ifnull
was passed to the constructor
-
-