package com.hai.enum_type;

import java.util.Objects;

/**
 * 设备类型
 * @author hurui
 */
public enum DeviceTypeEnum {
    type1(1 , "商鹏云打印"),
    type2(2, "ZKC云打印"),
    ;

    private Integer type;
    private String name;

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

    public static String getNameByType(Integer type) {
        for (DeviceTypeEnum 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;
    }
}
