package com.qmth.distributed.print.business.enums;

import java.util.Objects;

/**
 * @Description: 统计状态 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/9/9
 */
public enum StatisticsStatusEnum {

    FINISH("已完成"),

    UN_JOIN("未关联"),

    UN_FINISH("未完成");

    private String title;

    private StatisticsStatusEnum(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    /**
     * 状态转换 toName
     *
     * @param title
     * @return
     */
    public static String convertToName(String title) {
        for (StatisticsStatusEnum e : StatisticsStatusEnum.values()) {
            if (Objects.equals(title, e.getTitle())) {
                return e.name();
            }
        }
        return null;
    }
}
