All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dahuatech.icc.brm.enums.DeviceCategoryEnum Maven / Gradle / Ivy

There is a newer version: 1.0.13.7
Show newest version
package com.dahuatech.icc.brm.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * 设备大类
 */
public enum DeviceCategoryEnum {

    // 编码设备
    ENCODER(1, "device.encoder"),
    // 报警主机
    ALARM_HOST(3, "device.alarm.host"),
    // 卡口
    ANPR(5, "device.anpr"),
    // 智能设备
    DEVICE(7, "device.intelligent.device"),
    // 门禁设备
    ACCESS_CONTROL(8, "device.access.control"),
    // 动环设备
    RING(9, "device.moving.ring"),
    // 可视对讲设备
    VIMS(21, "device.vims"),
    // 出入口设备
    ENTRANCE(35, "device.entrance"),
    // 道闸设备
    GATE(36, "device.road.gate"),
    // 显示设备
    DISPLAY(37, "device.display"),
    // 显控设备
    WALL_CONTROL(45, "device.video.wall.control"),
    // 其他
    OTHER(99, "other"),
    ;

    private Integer id;

    private String type;

    DeviceCategoryEnum(Integer id, String type) {
        this.id = id;
        this.type = type;
    }

    public Integer getId() {
        return id;
    }

    public String getType() {
        return type;
    }

    public static String getTypeById(Integer id) {
        for(DeviceCategoryEnum deviceCategoryEnum : DeviceCategoryEnum.values()) {
            if(deviceCategoryEnum.getId().equals(id)) {
                return deviceCategoryEnum.getType();
            }
        }

        return "";
    }

    public static List getTypeListById(List ids) {
        List result = new ArrayList<>();
        if (ids == null || ids.size() == 0) return result;

        for(Integer id : ids) {
            String type = getTypeById(id);
            result.add(type);
        }
        return result;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy