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

import java.util.Objects;

/**
 * @Description: 选择类型enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/3/31
 */
public enum ChooseTypeEnum {

    ALL("全部");

    private String title;

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

    public String getTitle() {
        return title;
    }

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