org.infinispan.counter.configuration.Element Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-clustered-counter Show documentation
Show all versions of infinispan-clustered-counter Show documentation
Infinispan Clustered Counter module
The newest version!
package org.infinispan.counter.configuration;
import java.util.HashMap;
import java.util.Map;
/**
* @author Pedro Ruivo
* @since 9.0
*/
public enum Element {
//must be first
UNKNOWN(null),
COUNTERS("counters"),
LOWER_BOUND("lower-bound"),
STRONG_COUNTER("strong-counter"),
UPPER_BOUND("upper-bound"),
WEAK_COUNTER("weak-counter"),
;
private static final Map ELEMENTS;
static {
final Map map = new HashMap<>(8);
for (Element element : values()) {
final String name = element.name;
if (name != null) {
map.put(name, element);
}
}
ELEMENTS = map;
}
private final String name;
Element(final String name) {
this.name = name;
}
public static Element forName(final String localName) {
final Element element = ELEMENTS.get(localName);
return element == null ? UNKNOWN : element;
}
@Override
public String toString() {
return name;
}
}