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

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

import java.lang.reflect.Field;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 日期时间
 * @author xu
 * @date 2018/9/26 15:03
 * @see DateTimeColumn
 */
@Data
public class LayoutDateTimeColumn extends AbstractPanelLayoutColumn {

    private static final String TYPE = "DATE_TIME";
    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(
                LocalDateTime.class,
                Date.class
        );
    }


}
