Package guru.mikelue.foxglove.setting
Class LayeredDataSetting
java.lang.Object
guru.mikelue.foxglove.setting.LayeredDataSetting
- All Implemented Interfaces:
DataSettingInfo
A proxy of
DataSettingInfo for multi-layer settings.
The default setting of global is always added as the last priority.-
Constructor Summary
ConstructorsConstructorDescriptionLayeredDataSetting(DataSettingInfo... settings) Constructs the layered data setting with multiple settings. -
Method Summary
Modifier and TypeMethodDescriptionintUses the highest priority setting to get the default number of rows.getStatementSetter(ColumnMeta meta) Gets theCustomStatementSetterfor the given column metadata.booleanisAutoGenerating(ColumnMeta column) Gets whether or not to generate value automatically by the given properties of a column.resolveSupplier(ColumnMeta columnMeta) Retrieves the foundSupplierby priority of settings.
-
Constructor Details
-
LayeredDataSetting
Constructs the layered data setting with multiple settings. The usage priority is from first to last.- Parameters:
settings- The rest data setting info, can be null for some
-
-
Method Details
-
getDefaultNumberOfRows
public int getDefaultNumberOfRows()Uses the highest priority setting to get the default number of rows.- Specified by:
getDefaultNumberOfRowsin interfaceDataSettingInfo- Returns:
- The number of rows defined in the highest priority setting
- See Also:
-
resolveSupplier
Retrieves the foundSupplierby priority of settings.- Specified by:
resolveSupplierin interfaceDataSettingInfo- Type Parameters:
T- The type of value supplied by the resolvedSupplier- Parameters:
columnMeta- The metadata of column used to resolveSupplier- Returns:
- The resolved
Supplieror empty.
-
isAutoGenerating
Gets whether or not to generate value automatically by the given properties of a column. Additionally, theDataSetting.excludeWhen(ColumnMatcher)also affects this behavior.The default properties to generate value automatically:
The conditions used by this method will gives
truefor a column:- Not-excluded by
DataSetting.excludeWhen(ColumnMatcher) - Matches any customized matching by
DataSetting.columnMatcher(ColumnMatcher) - Not-excluded by
ColumnMeta.properties() - Matches type by
DataSetting.givenType(String) - Matches type by
DataSetting.givenType(JDBCType) - Not-excluded by not supported
JDBCTypes
- Specified by:
isAutoGeneratingin interfaceDataSettingInfo- Parameters:
column- The metadata of a column- Returns:
- Whether or not to generate value automatically
- Not-excluded by
-
getStatementSetter
Description copied from interface:DataSettingInfoGets theCustomStatementSetterfor the given column metadata.- Specified by:
getStatementSetterin interfaceDataSettingInfo- Parameters:
meta- The metadata of a column- Returns:
- The
CustomStatementSetterfor the given column metadata or empty
-