Class ConfigKey
java.lang.Object
org.apache.bookkeeper.common.conf.ConfigKey
A configuration key in a configuration.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConfigKey(boolean required, String name, Type type, String description, String documentation, Object defaultValue, List<String> optionValues, Validator validator, ConfigKeyGroup group, int orderInGroup, List<String> dependents, boolean deprecated, String deprecatedByConfigKey, String deprecatedSince, String since) Creates a newConfigKeyinstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigKey.ConfigKeyBuilderBuild a config key of name.Default value as a string representation.defaultValue(Object defaultValue) Default value as a string representation.The list of settings dependents on this setting.dependents(List<String> dependents) The list of settings dependents on this setting.booleanWhether this setting is deprecated or not.deprecated(boolean deprecated) Whether this setting is deprecated or not.The config key that deprecates this key.deprecatedByConfigKey(String deprecatedByConfigKey) The config key that deprecates this key.The version when this settings was deprecated.deprecatedSince(String deprecatedSince) The version when this settings was deprecated.Description of the configuration setting.description(String description) Description of the configuration setting.Documentation of the configuration setting.documentation(String documentation) Documentation of the configuration setting.booleanget(org.apache.commons.configuration2.Configuration conf) Retrieve the setting value from the provided conf.booleangetBoolean(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aBooleanvalue.Class<?>getClass(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aClassvalue.<T> Class<? extends T>Retrieve the setting from the configuration conf as aClassvalue.doublegetDouble(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aDoublevalue.intgetInt(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aIntegervalue.getList(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aClassvalue.longgetLong(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aLongvalue.shortgetShort(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aShortvalue.getString(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aStringvalue.group()The key-group to group settings together.group(ConfigKeyGroup group) The key-group to group settings together.inthashCode()static ConfigKey.ConfigKeyBuildername()Name of the configuration setting.Name of the configuration setting.The list of options for this setting.optionValues(List<String> optionValues) The list of options for this setting.intThe order of the setting in the key-group.orderInGroup(int orderInGroup) The order of the setting in the key-group.booleanrequired()Flag indicates whether the setting is required.required(boolean required) Flag indicates whether the setting is required.voidUpdate the setting name in the configuration conf with the provided value.since()The version when this setting was introduced.The version when this setting was introduced.toString()type()Type of the configuration setting.Type of the configuration setting.voidvalidate(org.apache.commons.configuration2.Configuration conf) Validate the setting is valid in the provided config conf.The validator used for validating configuration value.The validator used for validating configuration value.
-
Field Details
-
ORDERING
-
-
Constructor Details
-
ConfigKey
ConfigKey(boolean required, String name, Type type, String description, String documentation, Object defaultValue, List<String> optionValues, Validator validator, ConfigKeyGroup group, int orderInGroup, List<String> dependents, boolean deprecated, String deprecatedByConfigKey, String deprecatedSince, String since) Creates a newConfigKeyinstance.- Parameters:
required- Flag indicates whether the setting is required.name- Name of the configuration setting.type- Type of the configuration setting.description- Description of the configuration setting.documentation- Documentation of the configuration setting.defaultValue- Default value as a string representation.optionValues- The list of options for this setting.validator- The validator used for validating configuration value.group- The key-group to group settings together.orderInGroup- The order of the setting in the key-group.dependents- The list of settings dependents on this setting.deprecated- Whether this setting is deprecated or not.deprecatedByConfigKey- The config key that deprecates this key.deprecatedSince- The version when this settings was deprecated.since- The version when this setting was introduced.
-
-
Method Details
-
builder
Build a config key of name.- Parameters:
name- config key name- Returns:
- config key builder
-
equals
-
hashCode
public int hashCode() -
validate
Validate the setting is valid in the provided config conf.- Parameters:
conf- configuration to test- Throws:
ConfigException
-
set
Update the setting name in the configuration conf with the provided value.- Parameters:
conf- configuration to setvalue- value of the setting
-
getLong
public long getLong(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aLongvalue.- Parameters:
conf- configuration to retrieve the setting- Returns:
- the value as a long number
-
getInt
public int getInt(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aIntegervalue.- Parameters:
conf- configuration to retrieve the setting- Returns:
- the value as an integer number
-
getShort
public short getShort(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aShortvalue.- Parameters:
conf- configuration to retrieve the setting- Returns:
- the value as a short number
-
getBoolean
public boolean getBoolean(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aBooleanvalue.- Parameters:
conf- configuration to retrieve the setting- Returns:
- the value as a boolean flag
-
getDouble
public double getDouble(org.apache.commons.configuration2.Configuration conf) Retrieve the setting from the configuration conf as aDoublevalue.- Parameters:
conf- configuration to retrieve the setting- Returns:
- the value as a double number
-
getString
Retrieve the setting from the configuration conf as aStringvalue.- Parameters:
conf- configuration to retrieve the setting- Returns:
- the value as a string.
-
getClass
public <T> Class<? extends T> getClass(org.apache.commons.configuration2.Configuration conf, Class<T> interfaceCls) Retrieve the setting from the configuration conf as aClassvalue.- Parameters:
conf- configuration to retrieve the setting- Returns:
- the value as a class
-
getClass
Retrieve the setting from the configuration conf as aClassvalue.- Parameters:
conf- configuration to retrieve the setting- Returns:
- the value as a class
-
getList
Retrieve the setting from the configuration conf as aClassvalue.- Parameters:
conf- configuration to retrieve the setting- Returns:
- the value as list of values
-
get
Retrieve the setting value from the provided conf.- Returns:
- the setting value
-
internalBuilder
-
required
public boolean required()Flag indicates whether the setting is required. -
name
Name of the configuration setting. -
type
Type of the configuration setting. -
description
Description of the configuration setting. -
documentation
Documentation of the configuration setting. -
defaultValue
Default value as a string representation. -
optionValues
The list of options for this setting. -
validator
The validator used for validating configuration value. -
group
The key-group to group settings together. -
orderInGroup
public int orderInGroup()The order of the setting in the key-group. -
dependents
The list of settings dependents on this setting. -
deprecated
public boolean deprecated()Whether this setting is deprecated or not. -
deprecatedByConfigKey
The config key that deprecates this key. -
deprecatedSince
The version when this settings was deprecated. -
since
The version when this setting was introduced. -
required
Flag indicates whether the setting is required.- Returns:
this.
-
name
Name of the configuration setting.- Returns:
this.
-
type
Type of the configuration setting.- Returns:
this.
-
description
Description of the configuration setting.- Returns:
this.
-
documentation
Documentation of the configuration setting.- Returns:
this.
-
defaultValue
Default value as a string representation.- Returns:
this.
-
optionValues
The list of options for this setting.- Returns:
this.
-
validator
The validator used for validating configuration value.- Returns:
this.
-
group
The key-group to group settings together.- Returns:
this.
-
orderInGroup
The order of the setting in the key-group.- Returns:
this.
-
dependents
The list of settings dependents on this setting.- Returns:
this.
-
deprecated
Whether this setting is deprecated or not.- Returns:
this.
-
deprecatedByConfigKey
The config key that deprecates this key.- Returns:
this.
-
deprecatedSince
The version when this settings was deprecated.- Returns:
this.
-
since
The version when this setting was introduced.- Returns:
this.
-
toString
-