package com.tsi.navi.dto.enums;

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

public enum eLightsType {

    UNSPECIFIED(0, "UNSPECIFIED"),  //미지정
    STRAIGHT   (1, "STRAIGHT"),     //직진
    LEFT_TURN  (2, "LEFT_TURN"),    //좌회전
    PEDESTRIAN (3, "PEDESTRIAN"),   //보행자
    BICYCLE    (4, "BICYCLE"),      //자전거
    RIGHT_TURN (5, "RIGHT_TURN"),   //우회전
    BUS        (6, "BUS"),          //버스
    U_TURN     (7, "U_TURN");       //유턴

    private final int value;
    private final String string;

    private static final Map<Integer, eLightsType> map;
    static {
        map = new HashMap<>();
        for (eLightsType e : values()) {
            map.put(Integer.valueOf(e.value), e);
        }
    }
    public static eLightsType getByValue(int value) {
        return map.get(Integer.valueOf(value));
    }
    public static eLightsType getByValue(byte value) {
        int intValue = (int)(value & 0x0F);
        return getByValue(intValue);
    }

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

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