42 lines
694 B
Java
42 lines
694 B
Java
|
public enum Nation {
|
|||
|
A("A", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>͢"),
|
|||
|
B("B", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
|
|||
|
C("C", "<EFBFBD><EFBFBD><EFBFBD>ô<EFBFBD>"),
|
|||
|
D("D", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
;
|
|||
|
|
|||
|
private final String code;
|
|||
|
private final String value;
|
|||
|
|
|||
|
Nation(String code, String value) {
|
|||
|
this.code = code;
|
|||
|
this.value = value;
|
|||
|
}
|
|||
|
|
|||
|
public String getCode() {
|
|||
|
return code;
|
|||
|
}
|
|||
|
|
|||
|
public String getValue() {
|
|||
|
return value;
|
|||
|
}
|
|||
|
|
|||
|
public static Nation findByCode(String code) {
|
|||
|
for (Nation constant : values()) {
|
|||
|
if (constant.key.equals(code)) {
|
|||
|
return constant;
|
|||
|
}
|
|||
|
}
|
|||
|
return null; // <20><><EFBFBD><EFBFBD><EFBFBD>׳<EFBFBD> IllegalArgumentException
|
|||
|
}
|
|||
|
|
|||
|
public static Nation findByValue(String value) {
|
|||
|
for (Nation constant : values()) {
|
|||
|
if (constant.value.equals(value)) {
|
|||
|
return constant;
|
|||
|
}
|
|||
|
}
|
|||
|
return null; // <20><><EFBFBD><EFBFBD><EFBFBD>׳<EFBFBD> IllegalArgumentException
|
|||
|
}
|
|||
|
}
|