
org.jgroups.util.Ref Maven / Gradle / Ivy
package org.jgroups.util;
/**
* Keeps a reference to another object
* @author Bela Ban
* @since 5.2
*/
public class Ref {
protected T obj;
public Ref(T obj) {
this.obj=obj;
}
public T get() {return obj;}
public Ref set(T obj) {
this.obj=obj;
return this;
}
public boolean isSet() {return obj != null;}
public String toString() {
return String.format("ref<%s>", obj);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy