package com.lz.modules.app.enums;


public enum GenderEnum {

    male("男", 1),
    female("女", 2),
    unknow("未知", 3);

    private String name;
    private Integer code;

    GenderEnum(String name, Integer code) {
        this.name = name;
        this.code = code;
    }

    public static Integer findCodeByName(String name) {
        for (GenderEnum gender : GenderEnum.values()) {
            if (gender.getName().equals(name)) {
                return gender.getCode();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }


}
