Created
October 9, 2019 12:58
-
-
Save adixchen/1f3d590311d837f40528093b28eae97f to your computer and use it in GitHub Desktop.
language type enum
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@XmlType(name = "LanguageType") | |
@XmlEnum | |
public enum LanguageType { | |
@XmlEnumValue("de") | |
DE("de"), | |
@XmlEnumValue("fr") | |
FR("fr"), | |
@XmlEnumValue("it") | |
IT("it"), | |
@XmlEnumValue("en") | |
EN("en"); | |
private final String value; | |
LanguageType(String v) { | |
value = v; | |
} | |
public String value() { | |
return value; | |
} | |
public static LanguageType fromValue(String v) { | |
for (LanguageType c: LanguageType.values()) { | |
if (c.value.equals(v)) { | |
return c; | |
} | |
} | |
throw new IllegalArgumentException(v); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment