@Internal public final class PulsarConfigBuilder extends Object
Configuration
instance. Providing the common
validate logic for Pulsar source & sink.Constructor and Description |
---|
PulsarConfigBuilder() |
Modifier and Type | Method and Description |
---|---|
<T extends PulsarConfiguration> |
build(PulsarConfigValidator validator,
java.util.function.Function<Configuration,T> constructor)
Validate the current config instance and return a unmodifiable configuration.
|
<T> boolean |
contains(ConfigOption<T> option)
Validate if the config has a existed option.
|
<T> T |
get(ConfigOption<T> key)
Get an option-related config value.
|
<T> void |
override(ConfigOption<T> option,
T value)
Override the option with the given value.
|
<T> void |
set(ConfigOption<T> option,
T value)
Add a config option with a not null value.
|
void |
set(Configuration config)
Fill in a set of configs which shouldn't be duplicated.
|
void |
set(Properties properties)
Fill in a set of config properties which shouldn't be duplicated.
|
public <T> boolean contains(ConfigOption<T> option)
public <T> T get(ConfigOption<T> key)
key
- Config option instance.public <T> void set(ConfigOption<T> option, T value)
option
- Config option instance, contains key & type definition.value
- The config value which shouldn't be null.public void set(Configuration config)
config
- A set of configs.public void set(Properties properties)
properties
- A config which could be string type.public <T> void override(ConfigOption<T> option, T value)
set(ConfigOption, Object)
.public <T extends PulsarConfiguration> T build(PulsarConfigValidator validator, java.util.function.Function<Configuration,T> constructor)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.