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

import java.util.Objects;

/**
 * @Description: 自定义流程驳回类型
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/1/21
 */
public enum CustomFlowRejectTypeEnum {

    PREV("上一节点"),

    START("发起人节点"),

    PREV_ALL("该节点前全部节点");

    private String title;

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

    public String getTitle() {
        return title;
    }

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