package com.its.vms.domain.enums;

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

public enum eVmsFormType {

    eFormTp_traf_1   ( 11,  "11.소통상황(1단)"),
    eFormTp_traf_2   ( 12,  "12.소통상황(2단)"),
    eFormTp_traf_3   ( 13,  "13.소통상황(3단)"),
    eFormTp_traf_4   ( 14,  "14.소통상황(4단)"),
    eFormTp_figure   ( 15,  "15.소통상황(도형식배경소통정보)"),
    eFormTp_congest  ( 16,  "16.정체소통상황"),
    eFormTp_incident ( 20,  "20.돌발문안"),
    eFormTp_gongsa   ( 30,  "30.공사/행사문안"),
    eFormTp_hongbo   ( 40,  "40.홍보문안"),
    eFormTp_deture   ( 50,  "50.우회도로"),
    eFormTp_safe     ( 60,  "60.재난안전"),
    eFormTp_video    ( 70,  "70.동영상"),
    eFormTp_stream   ( 80,  "80.스트리밍영상"),
    eFormTp_atmp     ( 90,  "90.대기환경"),
    eFormTp_park     ( 100, "100.주차정보"),
    eFormTp_evehicle ( 110, "110.긴급차량우선신호");

    private final int value;
    private final String string;

    private static final Map<Integer, eVmsFormType> map;
    static {
        map = new HashMap<>();
        for (eVmsFormType e : values()) {
            map.put(e.value, e);
        }
    }

    public static eVmsFormType getValue(int value) {
        return map.get(value);
    }
    public static eVmsFormType getValue(byte value) {
        int intValue = (value & 0x0F);
        return map.get(intValue);
    }

    eVmsFormType(int value, String string) {
        this.value  = value;
        this.string = string;
    }

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

    @Override
    public String toString() {
        return this.string;
    }
}
