package cn.palmte.work.bean;

/**
 * @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
 */
public enum UnderwrittenModeEnum {
    PLAN_A(1,"A类-不垫资（战略合作）"),
    PLAN_B(2,"B类-不垫资（背靠背）"),
    PLAN_C(3,"C类-垫资（账期覆盖）"),
    PLAN_D(4,"D类-垫资（账期不覆盖");

    private int underwrittenMode;
    private String underwrittenModeStr;

    private UnderwrittenModeEnum(int underwrittenMode, String underwrittenModeStr) {
        this.underwrittenMode = underwrittenMode;
        this.underwrittenModeStr = underwrittenModeStr;
    }

    public int getUnderwrittenMode() {
        return underwrittenMode;
    }

    public void setUnderwrittenMode(int underwrittenMode) {
        this.underwrittenMode = underwrittenMode;
    }

    public String getUnderwrittenModeStr() {
        return underwrittenModeStr;
    }

    public void setUnderwrittenModeStr(String underwrittenModeStr) {
        this.underwrittenModeStr = underwrittenModeStr;
    }

    public static UnderwrittenModeEnum parseUnderwrittenMode(int underwrittenMode){
        if(underwrittenMode == 1){
            return PLAN_A;
        }
        if(underwrittenMode == 2){
            return PLAN_B;
        }
        if(underwrittenMode == 3){
            return PLAN_C;
        }
        if(underwrittenMode == 4){
            return PLAN_D;
        }
        throw new IllegalArgumentException("Unkown underwrittenMode:"+underwrittenMode);
    }
}
