org.ehcache.xml.model.TimeUnit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ehcache-xml Show documentation
Show all versions of ehcache-xml Show documentation
The module containing all XML parsing logic Ehcache 3
package org.ehcache.xml.model;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for time-unit.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <pre>
* <simpleType name="time-unit">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="nanos"/>
* <enumeration value="micros"/>
* <enumeration value="millis"/>
* <enumeration value="seconds"/>
* <enumeration value="minutes"/>
* <enumeration value="hours"/>
* <enumeration value="days"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "time-unit")
@XmlEnum
public enum TimeUnit {
@XmlEnumValue("nanos")
NANOS("nanos"),
@XmlEnumValue("micros")
MICROS("micros"),
@XmlEnumValue("millis")
MILLIS("millis"),
@XmlEnumValue("seconds")
SECONDS("seconds"),
@XmlEnumValue("minutes")
MINUTES("minutes"),
@XmlEnumValue("hours")
HOURS("hours"),
@XmlEnumValue("days")
DAYS("days");
private final String value;
TimeUnit(String v) {
value = v;
}
public String value() {
return value;
}
public static TimeUnit fromValue(String v) {
for (TimeUnit c: TimeUnit.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy