Package cdc.impex.templates
Class ColumnTemplate<T>
- java.lang.Object
-
- cdc.impex.templates.ColumnTemplate<T>
-
- Type Parameters:
T- The column data type.
public final class ColumnTemplate<T> extends Object
Description of a template column.A column is described by:
- A name
- A
Usage. - A data type.
- An optional description.
It is used when sample files are generated. - An optional
Checker.
It can be used to add more checks to data type, for example, to check the length of string, the domain of a number, ... - The severity of a failed check.
- A string to data type converter.
- A data type to string converter.
- Author:
- Damien Carbonne
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classColumnTemplate.Builder<T>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ColumnTemplate.Builder<T>builder(String name, Class<T> dataType)cdc.validation.checkers.Checker<T>getCheckerOrNull()cdc.issues.IssueSeveritygetCheckFailureSeverity()StringgetComment()Class<T>getDataType()StringgetDescription()Function<T,String>getExportConverter()Function<String,T>getImportConverter()StringgetName()PrimitivegetPrimitive()UsagegetUsage()booleanhasChecker()StringtoString()
-
-
-
Method Detail
-
getName
public String getName()
- Returns:
- The column name.
-
getUsage
public Usage getUsage()
- Returns:
- The column usage.
-
getDescription
public String getDescription()
- Returns:
- The column description.
-
getCheckerOrNull
public cdc.validation.checkers.Checker<T> getCheckerOrNull()
- Returns:
- The checker or
null.
-
hasChecker
public boolean hasChecker()
-
getCheckFailureSeverity
public cdc.issues.IssueSeverity getCheckFailureSeverity()
- Returns:
- The severity of a check failure.
-
getImportConverter
public Function<String,T> getImportConverter()
- Returns:
- the converter used to convert a string to data type.
-
getExportConverter
public Function<T,String> getExportConverter()
- Returns:
- the converter used to convert a data type to a string.
-
getComment
public String getComment()
- Returns:
- The comment that should be used to describe this column.
-
builder
public static <T> ColumnTemplate.Builder<T> builder(String name, Class<T> dataType)
-
-