package com.qmth.themis.business.enums;

import java.util.Objects;

/**
 * @Description: 题目类型 enum
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/10/21
 */
public enum AnswerTypeEnum {

    A("1", "A"),
    B("2", "B"),
    C("3", "C"),
    D("4", "D"),
    E("5", "E"),
    F("6", "F"),
    G("7", "G"),
    H("8", "H"),
    I("9", "I"),
    J("10", "J"),
    K("11", "K"),
    L("12", "L"),
    M("13", "M"),
    N("14", "N"),
    O("15", "O"),
    P("16", "P"),
    Q("17", "Q"),
    R("18", "R"),
    S("19", "S"),
    T("20", "T"),
    U("21", "U"),
    V("22", "V"),
    W("23", "W"),
    X("24", "X"),
    Y("25", "Y"),
    Z("26", "Z"),
    TRUE("TRUE", "对"),
    FALSE("FALSE", "错");

    private String type;

    private String title;

    private AnswerTypeEnum(String type, String title) {
        this.type = type;
        this.title = title;
    }

    /**
     * 状态转换 toTitle
     *
     * @param value
     * @return
     */
    public static String convertToTitle(String value) {
        for (AnswerTypeEnum e : AnswerTypeEnum.values()) {
            if (Objects.equals(value, e.getType())) {
                return e.getTitle();
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public String getTitle() {
        return title;
    }
}
