package com.its.vms.entity;

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

public enum eVmsImageType {

    vms_image_type_bmp(0, "bmp"),			/* 0:비트맵 */
    vms_image_type_gif(1, "gif"),			/* 1:GIF */
    vms_image_type_jpg(2, "jpg"),			/* 2:JPG */
    vms_image_type_png(3, "png"),			/* 3:PNG */
    vms_image_type_video(4, "avi"); 		/* 4:동영상 비디오 */

    private final int value;
    private final String string;

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

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

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

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