package com.qmth.paper.library.common.enums;

import java.util.Objects;

/**
 * @Description: 机构类型enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/7/29
 */
public enum OrgTypeEnum {

    SCHOOL("学校"),

    COLLEGE("学院"),

    PRINTING_HOUSE("印刷厂"),;

    private String title;

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

    public String getTitle() {
        return title;
    }

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