Package io.debezium.relational.mapping
Class ColumnMappers.Builder
- java.lang.Object
-
- io.debezium.relational.mapping.ColumnMappers.Builder
-
- Enclosing class:
- ColumnMappers
public static class ColumnMappers.Builder extends Object
A builder ofSelectors
.- Author:
- Randall Hauch
-
-
Field Summary
Fields Modifier and Type Field Description private List<ColumnMappers.MapperRule>
rules
private Selectors.TableIdToStringMapper
tableIdMapper
-
Constructor Summary
Constructors Constructor Description Builder(Selectors.TableIdToStringMapper tableIdMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnMappers
build()
String
fullyQualifiedColumnDatatype(TableId tableId, Column column)
String
fullyQualifiedColumnName(TableId tableId, Column column)
ColumnMappers.Builder
map(String fullyQualifiedColumnNames, ColumnMapper mapper)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.ColumnMappers.Builder
map(String fullyQualifiedColumnNames, Class<ColumnMapper> mapperClass)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.ColumnMappers.Builder
map(String fullyQualifiedColumnNames, Class<ColumnMapper> mapperClass, Configuration config)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.ColumnMappers.Builder
map(String fullyQualifiedColumnNames, String mapperClassName)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.ColumnMappers.Builder
map(String fullyQualifiedColumnNames, String mapperClassName, Configuration config)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.ColumnMappers.Builder
mapByDatatype(String columnDatatypes, ColumnMapper mapper)
String
mappedTableColumnDatatype(TableId tableId, Column column)
String
mappedTableColumnName(TableId tableId, Column column)
private TableId
mappedTableId(TableId tableId)
ColumnMappers.Builder
maskStrings(String fullyQualifiedColumnNames, int numberOfChars)
Use a string of the specified number of '*' characters to mask the string values for each of the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.ColumnMappers.Builder
maskStrings(String fullyQualifiedColumnNames, int numberOfChars, char maskChar)
Use a string of the specified number of characters to mask the string values for each of the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.ColumnMappers.Builder
maskStrings(String fullyQualifiedColumnNames, String maskValue)
Use the specified string to mask the string values for each of the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.ColumnMappers.Builder
maskStringsByHashing(String fullyQualifiedColumnNames, String hashAlgorithm, String salt)
ColumnMappers.Builder
propagateSourceTypeToSchemaParameter(String fullyQualifiedColumnNames, String value)
ColumnMappers.Builder
propagateSourceTypeToSchemaParameterByDatatype(String columnDatatypes, String value)
ColumnMappers.Builder
truncateStrings(String fullyQualifiedColumnNames, int maxLength)
Truncate to a maximum length the string values for each of the columns with the fully-qualified names.
-
-
-
Field Detail
-
rules
private final List<ColumnMappers.MapperRule> rules
-
tableIdMapper
private final Selectors.TableIdToStringMapper tableIdMapper
-
-
Constructor Detail
-
Builder
public Builder(Selectors.TableIdToStringMapper tableIdMapper)
-
-
Method Detail
-
map
public ColumnMappers.Builder map(String fullyQualifiedColumnNames, ColumnMapper mapper)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.- Parameters:
fullyQualifiedColumnNames
- the comma-separated list of fully-qualified column names; may not be nullmapper
- the column mapping function that will be used to map actual values into values used in the output record; null if an existing mapping function should be removed- Returns:
- this object so that methods can be chained together; never null
-
mapByDatatype
public ColumnMappers.Builder mapByDatatype(String columnDatatypes, ColumnMapper mapper)
-
fullyQualifiedColumnDatatype
public String fullyQualifiedColumnDatatype(TableId tableId, Column column)
-
map
public ColumnMappers.Builder map(String fullyQualifiedColumnNames, Class<ColumnMapper> mapperClass)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.- Parameters:
fullyQualifiedColumnNames
- the comma-separated list of fully-qualified column names; may not be nullmapperClass
- the Java class that implementsBiFunction<Column, Object, Object>
and that will be used to map actual values into values used in the output record; may not be null- Returns:
- this object so that methods can be chained together; never null
-
map
public ColumnMappers.Builder map(String fullyQualifiedColumnNames, Class<ColumnMapper> mapperClass, Configuration config)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.- Parameters:
fullyQualifiedColumnNames
- the comma-separated list of fully-qualified column names; may not be nullmapperClass
- the Java class that implementsBiFunction<Column, Object, Object>
and that will be used to map actual values into values used in the output record; may not be nullconfig
- the configuration to pass to theColumnMapper
instance; may be null- Returns:
- this object so that methods can be chained together; never null
-
truncateStrings
public ColumnMappers.Builder truncateStrings(String fullyQualifiedColumnNames, int maxLength)
Truncate to a maximum length the string values for each of the columns with the fully-qualified names. Only columnsString
values can be truncated.- Parameters:
fullyQualifiedColumnNames
- the comma-separated list of fully-qualified column names; may not be nullmaxLength
- the maximum number of characters to appear in the value- Returns:
- this object so that methods can be chained together; never null
-
maskStrings
public ColumnMappers.Builder maskStrings(String fullyQualifiedColumnNames, int numberOfChars)
Use a string of the specified number of '*' characters to mask the string values for each of the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.- Parameters:
fullyQualifiedColumnNames
- the comma-separated list of fully-qualified column names; may not be nullnumberOfChars
- the number of mask characters to be used in the mask value- Returns:
- this object so that methods can be chained together; never null
-
maskStrings
public ColumnMappers.Builder maskStrings(String fullyQualifiedColumnNames, int numberOfChars, char maskChar)
Use a string of the specified number of characters to mask the string values for each of the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.- Parameters:
fullyQualifiedColumnNames
- the comma-separated list of fully-qualified column names; may not be nullnumberOfChars
- the number of mask characters to be used in the mask valuemaskChar
- the character to be used; may not be null- Returns:
- this object so that methods can be chained together; never null
-
maskStrings
public ColumnMappers.Builder maskStrings(String fullyQualifiedColumnNames, String maskValue)
Use the specified string to mask the string values for each of the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.- Parameters:
fullyQualifiedColumnNames
- the comma-separated list of fully-qualified column names; may not be nullmaskValue
- the value to be used in place of the actual value; may not be null- Returns:
- this object so that methods can be chained together; never null
-
maskStringsByHashing
public ColumnMappers.Builder maskStringsByHashing(String fullyQualifiedColumnNames, String hashAlgorithm, String salt)
-
propagateSourceTypeToSchemaParameter
public ColumnMappers.Builder propagateSourceTypeToSchemaParameter(String fullyQualifiedColumnNames, String value)
-
propagateSourceTypeToSchemaParameterByDatatype
public ColumnMappers.Builder propagateSourceTypeToSchemaParameterByDatatype(String columnDatatypes, String value)
-
map
public ColumnMappers.Builder map(String fullyQualifiedColumnNames, String mapperClassName)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.- Parameters:
fullyQualifiedColumnNames
- the comma-separated list of fully-qualified column names; may not be nullmapperClassName
- the name of the Java class that implementsBiFunction<Column, Object, Object>
and that will be used to map actual values into values used in the output record; null if an existing mapping function should be removed- Returns:
- this object so that methods can be chained together; never null
-
map
public ColumnMappers.Builder map(String fullyQualifiedColumnNames, String mapperClassName, Configuration config)
Set a mapping function for the columns with fully-qualified names that match the given comma-separated list of regular expression patterns.- Parameters:
fullyQualifiedColumnNames
- the comma-separated list of fully-qualified column names; may not be nullmapperClassName
- the name of the Java class that implementsBiFunction<Column, Object, Object>
and that will be used to map actual values into values used in the output record; null if an existing mapping function should be removedconfig
- the configuration to pass to theColumnMapper
instance; may be null- Returns:
- this object so that methods can be chained together; never null
-
build
public ColumnMappers build()
Build thePredicate
that determines whether a table identified by a givenTableId
is to be included.- Returns:
- the table selection predicate; never null
-
-