package kr.co.hanwha.hifive.enums;

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

public enum AddTaskType {
    /**
     * 새로운 TASK 등록
     */
    NEW(0),
    /**
     * TASK 수정
     */
    EDIT(1),
    /**
     * TASK 수정 후 재요청
     */
    RE_REQUEST(2);

    private int mCode = 0;

    AddTaskType(int code) {
        mCode = code;
    }

    public int getCode() {
        return mCode;
    }

    private static Map map = new HashMap<>();

    static {
        for (AddTaskType type : AddTaskType.values()) {
            map.put(type.mCode, type);
        }
    }

    public static AddTaskType valueOf(int code) {
        return (AddTaskType) map.get(code);
    }
}
