package com.qmth.sop.common.enums;

import java.util.Objects;

/**
 * @Description: 流程type
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/12/21
 */
public enum FlowJoinTypeEnum {

    NEW("新建"),

    RESTART("重新提交");

    private String title;

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

    public String getTitle() {
        return title;
    }

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