package com.its.op.entity.domain;

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

// 결측보정 소스
public enum eAdjsSorc implements ICodeValue {

    MCS0("MCS0", "[MCS0] 결측보정 없음"),
    MCS1("MCS1", "[MCS1] 링크5분패턴"),
    MCS2("MCS2", "[MCS2] 15분이동평균"),
    MCS3("MCS3", "[MCS3] 링크15분패턴"),
    MCS8("MCS8", "[MCS8] 결측보정실패"),
    MCS9("MCS9", "[MCS9] 결측보정오류");

    private final String code;
    private final String value;

    private static final Map<String, eAdjsSorc> map;
    static {
        map = new HashMap<>();
        for (eAdjsSorc e : values()) {
            map.put(e.code, e);
        }
    }

    eAdjsSorc(String code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    @Override
    public String getUnknown() {
        return "LTC0";
    }

    public static String findValue(String code) {
        // FOR KISA Secure Coding pass
        //return map.get(code).getValue();
        String result = map.get(code).getValue();
        return result;
    }

}
