
com.alachisoft.ncache.client.ConnectivityStatus Maven / Gradle / Ivy
package com.alachisoft.ncache.client;
/**
* Represents client connectivity status.
*/
public enum ConnectivityStatus {
/**
* Client is connected to the Cache.
*/
Connected(1),
/**
* Client is disconnected from Cache.
*/
Disconnected(0);
public static final int SIZE = java.lang.Integer.SIZE;
private static java.util.HashMap mappings;
private int intValue;
private ConnectivityStatus(int value) {
intValue = value;
getMappings().put(value, this);
}
private static java.util.HashMap getMappings() {
if (mappings == null) {
synchronized (ConnectivityStatus.class) {
if (mappings == null) {
mappings = new java.util.HashMap();
}
}
}
return mappings;
}
public static ConnectivityStatus forValue(int value) {
return getMappings().get(value);
}
/**
* Order is important in enums.By using getValue() method, each enum constant index can be found, just like array index.
* @return enum constant index
*/
public int getValue() {
return intValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy