package com.its.vms.domain.enums;

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

public enum eVmsScheduleType {

    eSchTp_traffic  ( 0,  "0.교통"),
    eSchTp_incident ( 1,  "1.돌발"),
    eSchTp_gongsa   ( 2,  "2.공사행사"),
    eSchTp_hongbo   ( 3,  "3.홍보"),
    eSchTp_deture   ( 4,  "4.우회"),
    eSchTp_congest  ( 5,  "5.정체"),
    eSchTp_safe     ( 6,  "6.안전"),
    eSchTp_video    ( 7,  "7.동영상"),
    eSchTp_stream   ( 8,  "8.스트리밍영상"),
    eSchTp_atmp     ( 9,  "9.대기환경"),
    eSchTp_park     ( 10, "10.주차정보"),
    eSchTp_evehicle ( 11, "11.긴급차량우선신호");

    private final int value;
    private final String string;

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

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

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

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

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