package com.hai.enum_type;

import java.util.Objects;

/**
 * 订单状态
 * @author hurui
 */
public enum OperatorEnum {
    type1(1 , "电信运营商"),
    type2(2 , "移动运营商"),
    type3(3 , "联通运营商"),
            ;

    private Integer type;
    private String name;

    OperatorEnum(int type , String name) {
        this.type = type;
        this.name = name;
    }
    public static String getNameByType(Integer type) {
        for (OperatorEnum 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;
    }
}
