package com.lz.modules.app.enums;


public enum MaritalStatusEnum {

    unmarried("未婚", 0),
    married("已婚", 1);

    private String name;
    private Integer code;

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

    public static Integer findCodeByName(String name) {
        for (MaritalStatusEnum gender : MaritalStatusEnum.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;
    }


}
