package com.brframework.commoncms.core.layout.column;

import com.google.common.collect.Lists;
import com.brframework.commoncms.core.layout.AbstractPanelLayoutColumn;
import lombok.Data;

import java.lang.reflect.Field;
import java.util.List;

/**
 * @author xu
 * @date 2018/10/9 17:19
 */
@Data
public class LayoutNumberColumn extends AbstractPanelLayoutColumn {

    private static final String TYPE_DEF = "NUMBER";
    private String key;
    private String title;
    /** 可输入的最小值 */
    private Integer min;
    /** 可输入的最大值 */
    private Integer max;

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public String getType() {
        return TYPE_DEF;
    }

    @Override
    public void create(Field columnField) throws Throwable {
        init(columnField);
    }

    @Override
    public List<Class<?>> supportType() {
        return Lists.newArrayList(
                Integer.class
        );
    }

}
