package com.wdkl.ncs.android.middleware.tcp.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * TCP传输对象的类型
 */
public enum TcpType {
    CALLBACK("TCP反馈"),
    PHONE("普通电话"),
    VOICE("语音"),
    VIDEO("视频"),
    SOS("紧急呼叫"),
    REINFORCE("增援"),
    IM("留言"),
    EVENT("事件"),
    SIDE("边外信息"),
    DEVICE("设备"),
    DATA("数据"),
    BROADCAST("广播"),
    ENTRACEGUARD("门禁"),
    CHANNELIM("频道留言"),
    TIME("时间");

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

    private final static Map<String , TcpType> ENUM_MAP = new HashMap<String, TcpType>();
    static {
        for(TcpType v : values()) {
            ENUM_MAP.put(v.toString() , v);
        }
    }
    public static TcpType fromString(String v) {
        TcpType userOptionEnum = ENUM_MAP.get(v);
        return userOptionEnum == null ? CALLBACK :userOptionEnum;
    }
}
