org.jgroups.util.ImmutableReference Maven / Gradle / Ivy
package org.jgroups.util;
/**
* Simple class that holds an immutable reference to another object (or to
* null
).
*
* @author Brian Stansberry
*
*/
public class ImmutableReference {
private final T referent;
/**
* Create a new ImmutableReference.
*
* @param referent the object to refer to, or null
*/
public ImmutableReference(T referent) {
this.referent = referent;
}
/**
* Gets the wrapped object, if there is one.
*
* @return the object passed to the constructor, or null
if
* null
was passed to the constructor
*/
public T get() {
return referent;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy