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

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

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

/**
 * 日期
 * @author xu
 * @date 2018/9/26 15:03
 * @see DateColumn
 */
@Data
public class LayoutDateColumn extends AbstractPanelLayoutColumn {

    private static final String TYPE = "DATE";
    private String key;
    private String title;

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

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

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

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

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

}
