package com.qmth.teachcloud.exchange.common.enums.flow;

import java.util.Objects;

/**
 * @Description: 自定义流程发起人指定选择用户类型
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/1/21
 */
public enum CustomFlowApproveUserSelectRangeEnum {

    ALL("全单位"),

    ROLE("角色");

    private String title;

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

    public String getTitle() {
        return title;
    }

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