package com.inkasso.factoring.common.enums;

public enum PurchAccrualMarginCalcMethodDict {

    /**
     * 固定利率
     */
    FIXED_INTEREST("purchAccrualMarginCalcMethod_fixedInterest", "固定利率"),
    /**
     * 固定差额
     */
    FIXED_AMOUNT("purchAccrualMarginCalcMethod_fixedAmount", "固定差额");

    /** 编码 ***/
    private String code;
    /** 名称 **/
    private String cname;


    public String getCode() {
        return code;
    }

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

    public String getCname() {
        return cname;
    }

    public void setCname(String cname) {
        this.cname = cname;
    }

    PurchAccrualMarginCalcMethodDict(String code, String cname){
        this.code = code;
        this.cname = cname;
    }

    public static PurchAccrualMarginCalcMethodDict getByCode(String code){
        for(PurchAccrualMarginCalcMethodDict ft:values()){
            if(ft.code.equals(code)){
                return ft;
            }
        }
        return null;
    }
}
