public class AbstractConfig extends Object
This class holds both the original configuration that was provided as well as the parsed
Constructor and Description |
---|
AbstractConfig(ConfigDef definition,
Map<?,?> originals) |
AbstractConfig(ConfigDef definition,
Map<?,?> originals,
boolean doLog) |
AbstractConfig(Map<String,Object> parsedConfig) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
protected Object |
get(String key) |
Boolean |
getBoolean(String key) |
Class<?> |
getClass(String key) |
<T> T |
getConfiguredInstance(String key,
Class<T> t)
Get a configured instance of the give class specified by the given configuration key.
|
<T> List<T> |
getConfiguredInstances(String key,
Class<T> t)
Get a list of configured instances of the given class specified by the given configuration key.
|
<T> List<T> |
getConfiguredInstances(String key,
Class<T> t,
Map<String,Object> configOverrides)
Get a list of configured instances of the given class specified by the given configuration key.
|
Double |
getDouble(String key) |
Integer |
getInt(String key) |
List<String> |
getList(String key) |
Long |
getLong(String key) |
org.apache.kafka.common.config.types.Password |
getPassword(String key) |
Short |
getShort(String key) |
String |
getString(String key) |
int |
hashCode() |
void |
ignore(String key) |
void |
logUnused()
Log warnings for any unused configurations
|
Map<String,Object> |
originals() |
Map<String,String> |
originalsStrings()
Get all the original settings, ensuring that all values are of type String.
|
Map<String,Object> |
originalsWithPrefix(String prefix)
Gets all original settings with the given prefix, stripping the prefix before adding it to the output.
|
Set<String> |
unused() |
Map<String,?> |
values() |
public void ignore(String key)
public org.apache.kafka.common.config.types.Password getPassword(String key)
public Map<String,String> originalsStrings()
ClassCastException
- if any of the values are not stringspublic Map<String,Object> originalsWithPrefix(String prefix)
prefix
- the prefix to use as a filterpublic void logUnused()
public <T> T getConfiguredInstance(String key, Class<T> t)
key
- The configuration key for the classt
- The interface the class should implementpublic <T> List<T> getConfiguredInstances(String key, Class<T> t)
key
- The configuration key for the classt
- The interface the class should implementpublic <T> List<T> getConfiguredInstances(String key, Class<T> t, Map<String,Object> configOverrides)
key
- The configuration key for the classt
- The interface the class should implementconfigOverrides
- Configuration overrides to use.