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>rulesprivate Selectors.TableIdToStringMappertableIdMapper
-
Constructor Summary
Constructors Constructor Description Builder(Selectors.TableIdToStringMapper tableIdMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColumnMappersbuild()StringfullyQualifiedColumnDatatype(TableId tableId, Column column)StringfullyQualifiedColumnName(TableId tableId, Column column)ColumnMappers.Buildermap(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.Buildermap(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.Buildermap(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.Buildermap(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.Buildermap(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.BuildermapByDatatype(String columnDatatypes, ColumnMapper mapper)StringmappedTableColumnDatatype(TableId tableId, Column column)StringmappedTableColumnName(TableId tableId, Column column)private TableIdmappedTableId(TableId tableId)ColumnMappers.BuildermaskStrings(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.BuildermaskStrings(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.BuildermaskStrings(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.BuildermaskStringsByHashing(String fullyQualifiedColumnNames, String hashAlgorithm, String salt)ColumnMappers.BuilderpropagateSourceTypeToSchemaParameter(String fullyQualifiedColumnNames, String value)ColumnMappers.BuilderpropagateSourceTypeToSchemaParameterByDatatype(String columnDatatypes, String value)ColumnMappers.BuildertruncateStrings(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 theColumnMapperinstance; 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 columnsStringvalues 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 theColumnMapperinstance; may be null- Returns:
- this object so that methods can be chained together; never null
-
build
public ColumnMappers build()
Build thePredicatethat determines whether a table identified by a givenTableIdis to be included.- Returns:
- the table selection predicate; never null
-
-