package com.hfkj.sysenum;

import java.util.Objects;

/**
 * 调价日结果
 * @author hurui
 */
public enum OilPriceAdjustDateResultEnum {
    /**
     * 待定
     */
    status0(0 , "待定"),
    /**
     * 涨
     */
    status1(1 , "上涨"),
    /**
     * 跌
     */
    status2(2 , "下跌"),
    /**
     * 不调整
     */
    status3(3 , "不调整"),
    ;

    private Integer type;
    private String name;

    OilPriceAdjustDateResultEnum(int type , String name) {
        this.type = type;
        this.name = name;
    }

    public static OilPriceAdjustDateResultEnum getDataByType(Integer type) {
        for (OilPriceAdjustDateResultEnum ele : values()) {
            if(Objects.equals(type,ele.getType())) return ele;
        }
        return null;
    }

    public static String getNameByType(Integer type) {
        for (OilPriceAdjustDateResultEnum ele : values()) {
            if(Objects.equals(type,ele.getType())) return ele.getName();
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

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