
com.github.phantomthief.zookeeper.ZkNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zkconfig-resources Show documentation
Show all versions of zkconfig-resources Show documentation
A ZooKeeper based configuration resources holder
The newest version!
package com.github.phantomthief.zookeeper;
import static org.apache.commons.lang3.builder.ToStringBuilder.reflectionToString;
import static org.apache.commons.lang3.builder.ToStringStyle.SHORT_PREFIX_STYLE;
import java.util.function.Supplier;
/**
* @author w.vela
* Created on 2017-01-19.
*/
public class ZkNode implements Supplier {
private final T obj;
private final boolean exist;
ZkNode(T obj, boolean exist) {
this.obj = obj;
this.exist = exist;
}
@Override
public T get() {
return obj;
}
public boolean nodeExists() {
return exist;
}
@Override
public String toString() {
return reflectionToString(this, SHORT_PREFIX_STYLE);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy