package com.hfkj.sysenum;

import java.util.Objects;

/**
 * 设备类型
 * @author hurui
 */
public enum DeviceReceiptOutContentEnum {
    /**
     * 全部
     */
    content1(1 , "全部"),
    /**
     * 油站存根
     */
    content2(2 , "油站存根"),
    /**
     * 客户存根
     */
    content3(3 , "客户存根"),
    ;

    private Integer type;
    private String name;

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

    public static DeviceReceiptOutContentEnum getDataByType(Integer type) {
        for (DeviceReceiptOutContentEnum ele : values()) {
            if(Objects.equals(type,ele.getType())) return ele;
        }
        return null;
    }

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