package cn.estsh.i3plus.ext.mes.pcn.apiservice.util.rfid;

import org.springframework.util.StringUtils;

public enum RfidDataAreaEnum {

    DATA_AREA_PASSWORD(0, 0x00, "密码区"),
    DATA_AREA_EPC(1, 0x01, "EPC区"),
    DATA_AREA_TID(2, 0x02, "TID区"),
    DATA_AREA_USER(3, 0x03, "用户区");

    private Integer value;
    private int mem;
    private String description;

    public Integer getValue() {
        return this.value;
    }

    public int getMem() {
        return this.mem;
    }

    public String getDescription() {
        return this.description;
    }

    RfidDataAreaEnum(Integer value, int mem, String description) {
        this.value = value;
        this.mem = mem;
        this.description = description;
    }

    public static int valueOfMen(Integer val) {
        int tmp = DATA_AREA_USER.mem;
        if (!StringUtils.isEmpty(val)) {
            for (int i = 0; i < values().length; ++i) {
                if (values()[i].value == val) {
                    tmp = values()[i].mem;
                }
            }
        }
        return tmp;
    }


}
