package com.jwipc.supplier.constant;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
public enum AnswerType {
    /**
     * 单例对象
     */
    Single(1,"单选"),
    Multiple(2,"多选"),
    Text(3,"文本");
    private final int type;
    private final String name;

    /**
     * 默认构造函数
     */
    AnswerType(int type, String name) {
        this.type=type;
        this.name=name;
    }

    public int getType() {
        return type;
    }

    public static AnswerType forType(int type){
        for (AnswerType value : values()) {
            if(value.getType()==type){
                return value;
            }
        }
        return null;
    }
}
