public enum CustomerGender {
Gender, Male, Female, UNKNOWN;
public static CustomerGender fromString(String gender) {
for (CustomerGender customerGender : CustomerGender.values()) {
if (customerGender.name().equals(gender)) {
return customerGender;
}
}
return UNKNOWN;
}
}
网友评论