package thyyxxk.webserver.constants;

public enum Gender {
    MALE,
    FEMALE,
    UNKNOWN;

    public static Gender getGenderByCode(String code) {
        if (null == code) {
            return UNKNOWN;
        }
        switch (code) {
            case "1":
                return MALE;
            case "2":
                return FEMALE;
            default:
                return UNKNOWN;
        }
    }
}
