com.darwinsys.geo.Language Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of darwinsys-api Show documentation
Show all versions of darwinsys-api Show documentation
Ian Darwin's assorted Java stuff,
assembled as an API.
package com.darwinsys.geo;
/** Woefully-incomplete list of languages
*/
@SuppressWarnings("javadoc")
public enum Language {
en("English"),
cn_tw("Chinese(Cantonese)"),
cn_zh("Chinese(Mandarin)"),
cz("Czech"),
de("German"),
es("Spanish"),
fr("French"),
jp("Japanese"),
kr("Korean"),
pl("Polish"),
ru("Russian"),
uk("Ukrainian");
private final String name;
private Language(String name) {
this.name = name;
}
@Override public String toString() {
return name;
}
public String getName() {
return name;
}
public void setName(String name) {
throw new IllegalArgumentException("enums are immutable");
}
public static Language valueOfIgnoreCase(String name) {
for (Language cp : values()) {
if (cp.name.equalsIgnoreCase(name)) {
return cp;
}
}
throw new IllegalArgumentException("Unknown language " + name);
}
}