package com.hfkj.sysenum.gas;

import java.util.Objects;

public enum GasOrderCreateType {
    /**
     * 平台创建
     */
    TYPE1(1, "平台创建"),
    /**
     * API创建
     */
    TYPE2(2, "API创建"),
    ;

    private Integer number;

    private String name;

    GasOrderCreateType(int number, String name) {
        this.number = number;
        this.name = name;
    }

    /**
     * 根据类型查询数据
     * @param type
     * @return
     */
    public static GasOrderCreateType getDataByType(Integer type) {
        for (GasOrderCreateType ele : values()) {
            if(Objects.equals(type,ele.getNumber())) return ele;
        }
        return null;
    }

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

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

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