Package org.apache.kafka.clients.admin
Class ConfigEntry
java.lang.Object
org.apache.kafka.clients.admin.ConfigEntry
A class representing a configuration entry containing name, value and additional metadata.
The API of this class is evolving, see
Admin
for details.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Source of configuration entries.static class
Class representing a configuration synonym of aConfigEntry
.static enum
Data type of configuration entry. -
Constructor Summary
ConstructorDescriptionConfigEntry
(String name, String value) Create a configuration entry with the provided values.ConfigEntry
(String name, String value, ConfigEntry.ConfigSource source, boolean isSensitive, boolean isReadOnly, List<ConfigEntry.ConfigSynonym> synonyms, ConfigEntry.ConfigType type, String documentation) Create a configuration with the provided values. -
Method Summary
Modifier and TypeMethodDescriptionReturn the config documentation.boolean
int
hashCode()
boolean
Return whether the config value is the default or if it's been explicitly set.boolean
Return whether the config is read-only and cannot be updated.boolean
Return whether the config value is sensitive.name()
Return the config name.source()
Return the source of this configuration entry.synonyms()
Returns all config values that may be used as the value of this config along with their source, in the order of precedence.toString()
Override toString to redact sensitive value.type()
Return the config data type.value()
Return the value or null.
-
Constructor Details
-
ConfigEntry
Create a configuration entry with the provided values.- Parameters:
name
- the non-null config namevalue
- the config value or null
-
ConfigEntry
public ConfigEntry(String name, String value, ConfigEntry.ConfigSource source, boolean isSensitive, boolean isReadOnly, List<ConfigEntry.ConfigSynonym> synonyms, ConfigEntry.ConfigType type, String documentation) Create a configuration with the provided values.- Parameters:
name
- the non-null config namevalue
- the config value or nullsource
- the source of this config entryisSensitive
- whether the config value is sensitive, the broker never returns the value if it is sensitiveisReadOnly
- whether the config is read-only and cannot be updatedsynonyms
- Synonym configs in order of precedence
-
-
Method Details
-
name
Return the config name. -
value
Return the value or null. Null is returned if the config is unset or if isSensitive is true. -
source
Return the source of this configuration entry. -
isDefault
public boolean isDefault()Return whether the config value is the default or if it's been explicitly set. -
isSensitive
public boolean isSensitive()Return whether the config value is sensitive. The value is always set to null by the broker if the config value is sensitive. -
isReadOnly
public boolean isReadOnly()Return whether the config is read-only and cannot be updated. -
synonyms
Returns all config values that may be used as the value of this config along with their source, in the order of precedence. The list starts with the value returned in this ConfigEntry. The list is empty if synonyms were not requested usingDescribeConfigsOptions.includeSynonyms(boolean)
-
type
Return the config data type. -
documentation
Return the config documentation. -
equals
-
hashCode
public int hashCode() -
toString
Override toString to redact sensitive value. WARNING, user should be responsible to set the correct "isSensitive" field for each config entry.
-