package com.hai.enum_type;

import java.util.Objects;

/**
 * 加油站渠道商
 */
public enum GasChannel {
    type1(1 , "自建站"),
    type2(2 , "团油"),
    type3(3 , "加好油"),
    type4(4 , "金猪加油"),
    ;

    private Integer type;
    private String name;

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

    public static GasChannel getChannelByType(Integer type) {
        for (GasChannel ele : values()) {
            if(Objects.equals(type,ele.getType())) return ele;
        }
        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;
    }
}
