package com.szmirren.options; import java.util.ArrayList; import java.util.List; import com.szmirren.common.Constant; import com.szmirren.models.TableAttributeKeyValue; import javafx.collections.ObservableList; /** * SqlAssist属性的配置文件 * * @author <a href="http://szmirren.com">Mirren</a> * */ public class SqlAssistConfig { /** 设置的tableItem */ private List<TableAttributeKeyValue> tableItem = new ArrayList<>(); /** 生成模板的名字 */ private String templateName = Constant.TEMPLATE_NAME_SQL_ASSIST; /** 是否覆盖原文件 */ private boolean overrideFile; /** * 初始化 */ public SqlAssistConfig() { super(); } /** * 通过 ObservableList<TableAttributeKeyValue>初始化 * * @param tableItem */ public SqlAssistConfig(ObservableList<TableAttributeKeyValue> item) { super(); if (item != null && !item.isEmpty()) { tableItem.addAll(item); } } /** * 通过 ObservableList<TableAttributeKeyValue>初始化 * * @param tableItem */ public SqlAssistConfig(ObservableList<TableAttributeKeyValue> item, String templateName, boolean overrideFile) { super(); if (item != null && !item.isEmpty()) { tableItem.addAll(item); } this.templateName = templateName; this.overrideFile = overrideFile; } /** * 初始化默认参数 * * @return */ public SqlAssistConfig initDefaultValue() { return this; } /** * 设置属性集合 * * @return */ public List<TableAttributeKeyValue> getTableItem() { return tableItem; } /** * 获取属性集合 * * @param tableItem */ public void setTableItem(List<TableAttributeKeyValue> tableItem) { this.tableItem = tableItem; } /** * 获得模板的名称 * * @return */ public String getTemplateName() { return templateName; } /** * 设置模板的名称 * * @param templateName */ public void setTemplateName(String templateName) { this.templateName = templateName; } /** * 获取是否覆盖原文件 * * @return */ public boolean isOverrideFile() { return overrideFile; } /** * 设置是否覆盖原文件 * * @param overrideFile */ public void setOverrideFile(boolean overrideFile) { this.overrideFile = overrideFile; } @Override public String toString() { return "SqlAssistConfig [tableItem=" + tableItem + ", templateName=" + templateName + ", overrideFile=" + overrideFile + "]"; } }