package com.fjhx.purchase.entity.refund.enums;

import org.apache.commons.collections4.MapUtils;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * 退款状态枚举
 */
public enum RefundEnum {
    RE_0(0, "草稿"),
    RE_10(10, "部分退款"),
    RE_20(20, "已退款"),
    ;
    private int key;

    private String value;

    private static Map<Integer, String> map = new LinkedHashMap<>();

    RefundEnum(int key, String value) {
        this.key = key;
        this.value = value;
    }

    /**
     * 获取枚举map
     *
     * @return
     */
    public static Map<Integer, String> getMap() {
        if (MapUtils.isNotEmpty(map)) {
            return map;
        }
        for (RefundEnum ms : values()) {
            map.put(ms.key, ms.value);
        }
        return map;
    }

    public int getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
