package jnpf.model.enums;

/**
 * 是否有试岗期,0-没有，1-有 帮我写一个枚举
 */
public enum TrialPeriodStatus {
    NO(0, "没有"),
    YES(1, "有");

    private Integer code;
    private String description;

    TrialPeriodStatus(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    // 根据代码值获取枚举实例的静态方法
    public static TrialPeriodStatus fromCode(Integer code) {
        for (TrialPeriodStatus status : values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("试用期参数不正确: " + code);
    }
}
