package com.jwipc.supplier.constant;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
public enum TemplateFiledType {
    /**
     * 单例对象
     */
    BASIC(1, "基础字段"),
    ASSOCIATED(2, "关联字段"),
    NUMBER(3, "数字"),
    AREA(4, "区域下拉"),
    DICT(5, "字典字段"),
    DATE(6, "日期字段");

    private final int type;
    private final String name;

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

    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

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

