org.jgroups.util.ImmutableReference Maven / Gradle / Ivy
Go to download
This artifact provides a single jar that contains all classes required to use remote Jakarta Enterprise Beans and Jakarta Messaging, including
all dependencies. It is intended for use by those not using maven, maven users should just import the Jakarta Enterprise Beans and
Jakarta Messaging BOM's instead (shaded JAR's cause lots of problems with maven, as it is very easy to inadvertently end up
with different versions on classes on the class path).
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