package com.qmth.teachcloud.report.business.enums;

import java.util.Objects;

/**
 * @Description: 排序enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2021/6/21
 */
public enum OrderEnum {

    ASC("正序"),

    DESC("倒序");

    private String title;

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

    public String getTitle() {
        return title;
    }

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