package com.its.vms.domain.enums;

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

public enum eVmsFileType {

    vms_file_image         ((byte)0x01, "0x01.이미지 (JPG)"),
    vms_file_avi           ((byte)0x02, "0x02.동영상 (AVI)"),
    vms_file_stream_url    ((byte)0x03, "0x03.URL(스트리밍)"),
    vms_file_traffic_image ((byte)0x04, "0x04.소통정보 이미지"),
    vms_file_dspl_image    ((byte)0x05, "0x05.표출문구 이미지");

    private final byte value;
    private final String string;

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

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

    eVmsFileType(byte value, String string) {
        this.value  = value;
        this.string = string;
    }

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

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