Package io.debezium.config
Class Configuration.Builder
- java.lang.Object
-
- io.debezium.config.Configuration.Builder
-
- All Implemented Interfaces:
Configuration.ConfigBuilder<Configuration,Configuration.Builder>
- Enclosing interface:
- Configuration
public static class Configuration.Builder extends Object implements Configuration.ConfigBuilder<Configuration,Configuration.Builder>
A builder of Configuration objects.
-
-
Field Summary
Fields Modifier and Type Field Description private Properties
props
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
protected
Builder(Properties props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Configuration.Builder
apply(Consumer<Configuration.Builder> function)
Apply the function to this builder.Configuration
build()
Build and return the immutable configuration.Configuration.Builder
changeString(Field field, Function<String,String> function)
Apply the function to this builder to change a potentially existing string field.protected Configuration.Builder
changeString(String key, String defaultValue, Function<String,String> function)
Configuration.Builder
changeString(String key, Function<String,String> function)
Apply the function to this builder to change a potentially existing string field.Configuration.Builder
with(String key, String value)
Associate the given value with the specified key.Configuration.Builder
withDefault(String key, String value)
If there is no field with the specified key, then associate the given value with the specified key.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.debezium.config.Configuration.ConfigBuilder
changeBoolean, changeBoolean, changeDouble, changeDouble, changeFloat, changeFloat, changeInteger, changeInteger, changeLong, changeLong, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, with, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault, withDefault
-
-
-
-
Field Detail
-
props
private final Properties props
-
-
Constructor Detail
-
Builder
protected Builder()
-
Builder
protected Builder(Properties props)
-
-
Method Detail
-
with
public Configuration.Builder with(String key, String value)
Description copied from interface:Configuration.ConfigBuilder
Associate the given value with the specified key.- Specified by:
with
in interfaceConfiguration.ConfigBuilder<Configuration,Configuration.Builder>
- Parameters:
key
- the keyvalue
- the value- Returns:
- this builder object so methods can be chained together; never null
-
withDefault
public Configuration.Builder withDefault(String key, String value)
Description copied from interface:Configuration.ConfigBuilder
If there is no field with the specified key, then associate the given value with the specified key.- Specified by:
withDefault
in interfaceConfiguration.ConfigBuilder<Configuration,Configuration.Builder>
- Parameters:
key
- the keyvalue
- the value- Returns:
- this builder object so methods can be chained together; never null
-
apply
public Configuration.Builder apply(Consumer<Configuration.Builder> function)
Description copied from interface:Configuration.ConfigBuilder
Apply the function to this builder.- Specified by:
apply
in interfaceConfiguration.ConfigBuilder<Configuration,Configuration.Builder>
- Parameters:
function
- the predefined field for the key- Returns:
- this builder object so methods can be chained together; never null
-
changeString
public Configuration.Builder changeString(String key, Function<String,String> function)
Description copied from interface:Configuration.ConfigBuilder
Apply the function to this builder to change a potentially existing string field.- Specified by:
changeString
in interfaceConfiguration.ConfigBuilder<Configuration,Configuration.Builder>
- Parameters:
key
- the keyfunction
- the function that computes the new value given a possibly-existing value; may not be null- Returns:
- this builder object so methods can be chained together; never null
-
changeString
public Configuration.Builder changeString(Field field, Function<String,String> function)
Description copied from interface:Configuration.ConfigBuilder
Apply the function to this builder to change a potentially existing string field.- Specified by:
changeString
in interfaceConfiguration.ConfigBuilder<Configuration,Configuration.Builder>
- Parameters:
field
- the predefined field for the keyfunction
- the function that computes the new value given a possibly-existing value; may not be null- Returns:
- this builder object so methods can be chained together; never null
-
changeString
protected Configuration.Builder changeString(String key, String defaultValue, Function<String,String> function)
-
build
public Configuration build()
Description copied from interface:Configuration.ConfigBuilder
Build and return the immutable configuration.- Specified by:
build
in interfaceConfiguration.ConfigBuilder<Configuration,Configuration.Builder>
- Returns:
- the immutable configuration; never null
-
-