package com.its.vms.domain.enums;

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

public enum eVmsTextAlign {

    TEXT_ALIGN_LEFT   ( 0, "0.LEFT"),
    TEXT_ALIGN_RIGHT  ( 1, "1.RIGHT"),
    TEXT_ALIGN_CENTER ( 2, "2.CENTER");

    private final int value;
    private final String string;

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

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

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

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

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