package org.ehcache.xml.model;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
Java class for memory-unit.
The following schema fragment specifies the expected content contained within this class.
<simpleType name="memory-unit">
<restriction base="{http://www.w3.org/2001/XMLSchema}string">
<enumeration value="B"/>
<enumeration value="kB"/>
<enumeration value="MB"/>
<enumeration value="GB"/>
<enumeration value="TB"/>
<enumeration value="PB"/>
</restriction>
</simpleType>
/**
* <p>Java class for memory-unit.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="memory-unit">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="B"/>
* <enumeration value="kB"/>
* <enumeration value="MB"/>
* <enumeration value="GB"/>
* <enumeration value="TB"/>
* <enumeration value="PB"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "memory-unit")
@XmlEnum
public enum MemoryUnit {
B("B"),
@XmlEnumValue("kB")
K_B("kB"),
MB("MB"),
GB("GB"),
TB("TB"),
PB("PB");
private final String value;
MemoryUnit(String v) {
value = v;
}
public String value() {
return value;
}
public static MemoryUnit fromValue(String v) {
for (MemoryUnit c: MemoryUnit.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}