package com.hai.enum_type;

import java.util.Objects;

/**
 * 油号枚举
 */
public enum JinZhuJiaYouOilNo {

    NO_0("NO_0",0, "0#",1, "柴油"),
    NO_92("NO_92",92, "92#",2, "汽油"),
    NO_95("NO_95",95, "95#",2, "汽油"),
    NO_98("NO_98",98, "98#",2, "汽油"),
    ;

    private String oilNoCode;
    private Integer oilNo;
    private String oilNoName;
    private Integer oilType;
    private String oilTypeName;

    JinZhuJiaYouOilNo(String oilNoCode,Integer oilNo,String oilNoName,Integer oilType,String oilTypeName) {
        this.oilNoCode = oilNoCode;
        this.oilNo = oilNo;
        this.oilNoName = oilNoName;
        this.oilType = oilType;
        this.oilTypeName = oilTypeName;
    }

    public static JinZhuJiaYouOilNo getDataByCode(String code) {
        for (JinZhuJiaYouOilNo ele : values()) {
            if(Objects.equals(code,ele.getOilNoCode())) return ele;
        }
        return null;
    }

    public static JinZhuJiaYouOilNo getDataByOilNo(Integer oilNo) {
        for (JinZhuJiaYouOilNo ele : values()) {
            if(Objects.equals(oilNo,ele.getOilNo())) return ele;
        }
        return null;
    }

    public String getOilNoCode() {
        return oilNoCode;
    }

    public void setOilNoCode(String oilNoCode) {
        this.oilNoCode = oilNoCode;
    }

    public Integer getOilNo() {
        return oilNo;
    }

    public void setOilNo(Integer oilNo) {
        this.oilNo = oilNo;
    }

    public String getOilNoName() {
        return oilNoName;
    }

    public void setOilNoName(String oilNoName) {
        this.oilNoName = oilNoName;
    }

    public Integer getOilType() {
        return oilType;
    }

    public void setOilType(Integer oilType) {
        this.oilType = oilType;
    }

    public String getOilTypeName() {
        return oilTypeName;
    }

    public void setOilTypeName(String oilTypeName) {
        this.oilTypeName = oilTypeName;
    }
}
