package com.lantone.report.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @Description: 审核状态
 * @author: gaodm
 * @time: 2018/9/3 16:01
 */
public enum ExampleStatusEnum {

    NOT_EXAMPLE("0", "待审核"),
    REJECT_EXAMPLE("1", "驳回"),
    ADOPT_EXAMPLE("2", "审核通过");

    @Getter
    @Setter
    private String key;

    @Getter
    @Setter
    private String name;

    ExampleStatusEnum(String key, String name) {
        this.key = key;
        this.name = name;
    }

    public static ExampleStatusEnum getEnum(String key) {
        for (ExampleStatusEnum item : ExampleStatusEnum.values()) {
            if (item.key.equals(key)) {
                return item;
            }
        }
        return null;
    }

    public static String getName(String key) {
        ExampleStatusEnum item = getEnum(key);
        return item != null ? item.name : null;
    }
}
