Class Setting<T>
java.lang.Object
org.elasticsearch.common.settings.Setting<T>
- All Implemented Interfaces:
ToXContent
,ToXContentObject
- Direct Known Subclasses:
SecureSetting
,Setting.AffixSetting
public class Setting<T> extends java.lang.Object implements ToXContentObject
A setting. Encapsulates typical stuff like default value, parsing, and scope.
Some (SettingsProperty.Dynamic) can by modified at run time using the API.
All settings inside elasticsearch or in any of the plugins should use this type-safe and generic settings infrastructure
together with
AbstractScopedSettings
. This class contains several utility methods that makes it straight forward
to add settings for the majority of the cases. For instance a simple boolean settings can be defined like this:
public static final Setting<Boolean>; MY_BOOLEAN = Setting.boolSetting("my.bool.setting", true, SettingsProperty.NodeScope);
To retrieve the value of the setting a Settings
object can be passed directly to the get(Settings)
method.
final boolean myBooleanValue = MY_BOOLEAN.get(settings);It's recommended to use typed settings rather than string based settings. For example adding a setting for an enum type:
public enum Color {
RED, GREEN, BLUE;
}
public static final Setting<Color> MY_BOOLEAN =
new Setting<>("my.color.setting", Color.RED.toString(), Color::valueOf, SettingsProperty.NodeScope);
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Setting.AffixKey
A key that allows for static pre and suffix.static class
Setting.AffixSetting<T>
static interface
Setting.AffixSettingDependency
Allows an affix setting to declare a dependency on another affix setting.static class
Setting.GroupKey
static interface
Setting.Key
static class
Setting.ListKey
static class
Setting.Property
static interface
Setting.SettingDependency
Allows a setting to declare a dependency on another setting being set.static class
Setting.SimpleKey
static interface
Setting.Validator<T>
Represents a validator for a setting.Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
Fields Modifier and Type Field Description protected java.util.function.Function<Settings,java.lang.String>
defaultValue
-
Constructor Summary
Constructors Constructor Description Setting(java.lang.String key, java.lang.String defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)
Creates a new Setting instanceSetting(java.lang.String key, java.lang.String defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Validator<T> validator, Setting.Property... properties)
Creates a newSetting
instance.Setting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)
Creates a new Setting instanceSetting(java.lang.String key, Setting<T> fallBackSetting, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)
Creates a new Setting instanceSetting(Setting.Key key, java.util.function.Function<Settings,java.lang.String> defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)
Creates a new Setting instanceSetting(Setting.Key key, java.util.function.Function<Settings,java.lang.String> defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Validator<T> validator, Setting.Property... properties)
Creates a newSetting
instance.Setting(Setting.Key key, Setting<T> fallbackSetting, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)
Creates a new Setting instance -
Method Summary
Modifier and Type Method Description static <T> Setting.AffixSetting<T>
affixKeySetting(java.lang.String prefix, java.lang.String suffix, java.util.function.BiFunction<java.lang.String,java.lang.String,Setting<T>> delegateFactory, Setting.AffixSettingDependency... dependencies)
static <T> Setting.AffixSetting<T>
affixKeySetting(java.lang.String prefix, java.lang.String suffix, java.util.function.Function<java.lang.String,Setting<T>> delegateFactory, Setting.AffixSettingDependency... dependencies)
This setting type allows to validate settings that have the same type and a common prefix and suffix.static Setting<java.lang.Boolean>
boolSetting(java.lang.String key, boolean defaultValue, Setting.Property... properties)
static Setting<java.lang.Boolean>
boolSetting(java.lang.String key, boolean defaultValue, Setting.Validator<java.lang.Boolean> validator, Setting.Property... properties)
static Setting<java.lang.Boolean>
boolSetting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValueFn, Setting.Property... properties)
static Setting<java.lang.Boolean>
boolSetting(java.lang.String key, Setting<java.lang.Boolean> fallbackSetting, Setting.Property... properties)
static Setting<java.lang.Boolean>
boolSetting(java.lang.String key, Setting<java.lang.Boolean> fallbackSetting, Setting.Validator<java.lang.Boolean> validator, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValue, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(java.lang.String key, Setting<ByteSizeValue> fallbackSetting, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(java.lang.String key, ByteSizeValue value, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(java.lang.String key, ByteSizeValue defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, Setting.Property... properties)
void
diff(Settings.Builder builder, Settings source, Settings defaultSettings)
Add this setting to the builder if it doesn't exists in the source settings.static Setting<java.lang.Double>
doubleSetting(java.lang.String key, double defaultValue, double minValue, double maxValue, Setting.Property... properties)
static Setting<java.lang.Double>
doubleSetting(java.lang.String key, double defaultValue, double minValue, Setting.Property... properties)
boolean
equals(java.lang.Object o)
boolean
exists(Settings settings)
Returns true if and only if this setting is present in the given settings instance.boolean
existsOrFallbackExists(Settings settings)
Returns true if and only if this setting including fallback settings is present in the given settings instance.static Setting<java.lang.Float>
floatSetting(java.lang.String key, float defaultValue, float minValue, Setting.Property... properties)
static Setting<java.lang.Float>
floatSetting(java.lang.String key, float defaultValue, Setting.Property... properties)
T
get(Settings settings)
Returns the settings value.T
get(Settings primary, Settings secondary)
Returns the value for this setting but falls back to the second provided settings objectSetting<T>
getConcreteSetting(java.lang.String key)
T
getDefault(Settings settings)
Returns the default value for this setting.java.lang.String
getDefaultRaw(Settings settings)
Returns the default value string representation for this setting.java.lang.String
getKey()
Returns the settings key or a prefix if this setting is a group setting.java.util.EnumSet<Setting.Property>
getProperties()
Returns the setting propertiesSetting.Key
getRawKey()
Returns the original representation of a setting key.java.util.Set<Setting.SettingDependency>
getSettingsDependencies(java.lang.String key)
Returns a set of settings that are required at validation time.static Setting<Settings>
groupSetting(java.lang.String key, java.util.function.Consumer<Settings> validator, Setting.Property... properties)
static Setting<Settings>
groupSetting(java.lang.String key, Setting.Property... properties)
int
hashCode()
boolean
hasIndexScope()
Returnstrue
if this setting has an index scope, otherwisefalse
boolean
hasNodeScope()
Returnstrue
if this setting has a node scope, otherwisefalse
static Setting<java.lang.Integer>
intSetting(java.lang.String key, int defaultValue, int minValue, int maxValue, Setting.Property... properties)
static Setting<java.lang.Integer>
intSetting(java.lang.String key, int defaultValue, int minValue, Setting.Property... properties)
static Setting<java.lang.Integer>
intSetting(java.lang.String key, int defaultValue, int minValue, Setting.Validator<java.lang.Integer> validator, Setting.Property... properties)
static Setting<java.lang.Integer>
intSetting(java.lang.String key, int defaultValue, Setting.Property... properties)
static Setting<java.lang.Integer>
intSetting(java.lang.String key, Setting<java.lang.Integer> fallbackSetting, int minValue, Setting.Property... properties)
static Setting<java.lang.Integer>
intSetting(java.lang.String key, Setting<java.lang.Integer> fallbackSetting, int minValue, Setting.Validator<java.lang.Integer> validator, Setting.Property... properties)
boolean
isConsistent()
Returnstrue
if this setting's value can be checked for equality across all nodes.boolean
isDeprecated()
Returnstrue
if this setting is deprecated, otherwisefalse
boolean
isDynamic()
Returnstrue
if this setting is dynamically updateable, otherwisefalse
boolean
isFiltered()
Returnstrue
if this setting must be filtered, otherwisefalse
boolean
isFinal()
Returnstrue
if this setting is final, otherwisefalse
boolean
isInternalIndex()
boolean
isPrivateIndex()
static <T> Setting<java.util.List<T>>
listSetting(java.lang.String key, java.util.function.Function<java.lang.String,T> singleValueParser, java.util.function.Function<Settings,java.util.List<java.lang.String>> defaultStringValue, Setting.Property... properties)
static <T> Setting<java.util.List<T>>
listSetting(java.lang.String key, java.util.function.Function<java.lang.String,T> singleValueParser, java.util.function.Function<Settings,java.util.List<java.lang.String>> defaultStringValue, Setting.Validator<java.util.List<T>> validator, Setting.Property... properties)
static <T> Setting<java.util.List<T>>
listSetting(java.lang.String key, java.util.List<java.lang.String> defaultStringValue, java.util.function.Function<java.lang.String,T> singleValueParser, Setting.Property... properties)
static <T> Setting<java.util.List<T>>
listSetting(java.lang.String key, java.util.List<java.lang.String> defaultStringValue, java.util.function.Function<java.lang.String,T> singleValueParser, Setting.Validator<java.util.List<T>> validator, Setting.Property... properties)
static <T> Setting<java.util.List<T>>
listSetting(java.lang.String key, Setting<java.util.List<T>> fallbackSetting, java.util.function.Function<java.lang.String,T> singleValueParser, java.util.function.Function<Settings,java.util.List<java.lang.String>> defaultStringValue, Setting.Property... properties)
static <T> Setting<java.util.List<T>>
listSetting(java.lang.String key, Setting<java.util.List<T>> fallbackSetting, java.util.function.Function<java.lang.String,T> singleValueParser, java.util.function.Function<Settings,java.util.List<java.lang.String>> defaultStringValue, Setting.Validator<java.util.List<T>> validator, Setting.Property... properties)
static <T> Setting<java.util.List<T>>
listSetting(java.lang.String key, Setting<java.util.List<T>> fallbackSetting, java.util.function.Function<java.lang.String,T> singleValueParser, Setting.Property... properties)
static Setting<java.lang.Long>
longSetting(java.lang.String key, long defaultValue, long minValue, Setting.Property... properties)
boolean
match(java.lang.String toTest)
Returnstrue
iff the given key matches the settings key or if this setting is a group setting if the given key is part of the settings group.static Setting<ByteSizeValue>
memorySizeSetting(java.lang.String key, java.lang.String defaultPercentage, Setting.Property... properties)
Creates a setting which specifies a memory size.static Setting<ByteSizeValue>
memorySizeSetting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValue, Setting.Property... properties)
Creates a setting which specifies a memory size.static Setting<ByteSizeValue>
memorySizeSetting(java.lang.String key, ByteSizeValue defaultValue, Setting.Property... properties)
Creates a setting which specifies a memory size.static ByteSizeValue
parseByteSize(java.lang.String s, ByteSizeValue minValue, ByteSizeValue maxValue, java.lang.String key)
static int
parseInt(java.lang.String s, int minValue, int maxValue, java.lang.String key)
static int
parseInt(java.lang.String s, int minValue, java.lang.String key)
static int
parseInt(java.lang.String s, int minValue, java.lang.String key, boolean isFiltered)
static long
parseLong(java.lang.String s, long minValue, java.lang.String key)
static TimeValue
parseTimeValue(java.lang.String s, TimeValue minValue, java.lang.String key)
static Setting<TimeValue>
positiveTimeSetting(java.lang.String key, Setting<TimeValue> fallbackSetting, TimeValue minValue, Setting.Property... properties)
static Setting<TimeValue>
positiveTimeSetting(java.lang.String key, TimeValue defaultValue, Setting.Property... properties)
static <T> Setting.AffixSetting<T>
prefixKeySetting(java.lang.String prefix, java.util.function.Function<java.lang.String,Setting<T>> delegateFactory)
This setting type allows to validate settings that have the same type and a common prefix.static Setting<java.lang.String>
simpleString(java.lang.String key, java.lang.String defaultValue, Setting.Property... properties)
Creates a new Setting instance with a String valuestatic Setting<java.lang.String>
simpleString(java.lang.String key, java.lang.String defaultValue, Setting.Validator<java.lang.String> validator, Setting.Property... properties)
static Setting<java.lang.String>
simpleString(java.lang.String key, Setting.Property... properties)
static Setting<java.lang.String>
simpleString(java.lang.String key, Setting.Validator<java.lang.String> validator, Setting.Property... properties)
static Setting<java.lang.String>
simpleString(java.lang.String key, Setting.Validator<java.lang.String> validator, Setting<java.lang.String> fallback, Setting.Property... properties)
static Setting<java.lang.String>
simpleString(java.lang.String key, Setting<java.lang.String> fallback, java.util.function.Function<java.lang.String,java.lang.String> parser, Setting.Property... properties)
static Setting<java.lang.String>
simpleString(java.lang.String key, Setting<java.lang.String> fallback, Setting.Property... properties)
static Setting<TimeValue>
timeSetting(java.lang.String key, java.util.function.Function<Settings,TimeValue> defaultValue, TimeValue minValue, Setting.Property... properties)
static Setting<TimeValue>
timeSetting(java.lang.String key, Setting<TimeValue> fallbackSetting, Setting.Property... properties)
static Setting<TimeValue>
timeSetting(java.lang.String key, Setting<TimeValue> fallBackSetting, Setting.Validator<TimeValue> validator, Setting.Property... properties)
static Setting<TimeValue>
timeSetting(java.lang.String key, Setting<TimeValue> fallbackSetting, TimeValue minValue, Setting.Property... properties)
static Setting<TimeValue>
timeSetting(java.lang.String key, TimeValue defaultValue, Setting.Property... properties)
static Setting<TimeValue>
timeSetting(java.lang.String key, TimeValue defaultValue, TimeValue minValue, Setting.Property... properties)
static Setting<TimeValue>
timeSetting(java.lang.String key, TimeValue defaultValue, TimeValue minValue, TimeValue maxValue, Setting.Property... properties)
java.lang.String
toString()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
static Setting<Version>
versionSetting(java.lang.String key, Version defaultValue, Setting.Property... properties)
-
Field Details
-
Constructor Details
-
Setting
public Setting(Setting.Key key, java.util.function.Function<Settings,java.lang.String> defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)Creates a new Setting instance- Parameters:
key
- the settings key for this setting.defaultValue
- a default value function that returns the default values string representation.parser
- a parser that parses the string rep into a complex datatype.properties
- properties for this setting like scope, filtering...
-
Setting
public Setting(Setting.Key key, java.util.function.Function<Settings,java.lang.String> defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Validator<T> validator, Setting.Property... properties)Creates a newSetting
instance.- Parameters:
key
- the settings key for this settingdefaultValue
- a default value function that results a string representation of the default valueparser
- a parser that parses a string representation into the concrete type for this settingvalidator
- aSetting.Validator
for validating this settingproperties
- properties for this setting
-
Setting
public Setting(java.lang.String key, java.lang.String defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)Creates a new Setting instance- Parameters:
key
- the settings key for this setting.defaultValue
- a default value.parser
- a parser that parses the string rep into a complex datatype.properties
- properties for this setting like scope, filtering...
-
Setting
public Setting(java.lang.String key, java.lang.String defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Validator<T> validator, Setting.Property... properties)Creates a newSetting
instance.- Parameters:
key
- the settings key for this settingdefaultValue
- a default value function that results a string representation of the default valueparser
- a parser that parses a string representation into the concrete type for this settingvalidator
- aSetting.Validator
for validating this settingproperties
- properties for this setting
-
Setting
public Setting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValue, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)Creates a new Setting instance- Parameters:
key
- the settings key for this setting.defaultValue
- a default value function that returns the default values string representation.parser
- a parser that parses the string rep into a complex datatype.properties
- properties for this setting like scope, filtering...
-
Setting
public Setting(Setting.Key key, Setting<T> fallbackSetting, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)Creates a new Setting instance- Parameters:
key
- the settings key for this setting.fallbackSetting
- a setting who's value to fallback on if this setting is not definedparser
- a parser that parses the string rep into a complex datatype.properties
- properties for this setting like scope, filtering...
-
Setting
public Setting(java.lang.String key, Setting<T> fallBackSetting, java.util.function.Function<java.lang.String,T> parser, Setting.Property... properties)Creates a new Setting instance- Parameters:
key
- the settings key for this setting.fallBackSetting
- a setting to fall back to if the current setting is not set.parser
- a parser that parses the string rep into a complex datatype.properties
- properties for this setting like scope, filtering...
-
-
Method Details
-
getKey
public final java.lang.String getKey()Returns the settings key or a prefix if this setting is a group setting. Note: this method should not be used to retrieve a value from aSettings
object. Useget(Settings)
instead- See Also:
isGroupSetting()
-
getRawKey
Returns the original representation of a setting key. -
isDynamic
public final boolean isDynamic()Returnstrue
if this setting is dynamically updateable, otherwisefalse
-
isFinal
public final boolean isFinal()Returnstrue
if this setting is final, otherwisefalse
-
isInternalIndex
public final boolean isInternalIndex() -
isPrivateIndex
public final boolean isPrivateIndex() -
getProperties
Returns the setting properties- See Also:
Setting.Property
-
isFiltered
public boolean isFiltered()Returnstrue
if this setting must be filtered, otherwisefalse
-
hasNodeScope
public boolean hasNodeScope()Returnstrue
if this setting has a node scope, otherwisefalse
-
isConsistent
public boolean isConsistent()Returnstrue
if this setting's value can be checked for equality across all nodes. OnlySecureSetting
instances may have this qualifier. -
hasIndexScope
public boolean hasIndexScope()Returnstrue
if this setting has an index scope, otherwisefalse
-
isDeprecated
public boolean isDeprecated()Returnstrue
if this setting is deprecated, otherwisefalse
-
getDefaultRaw
Returns the default value string representation for this setting.- Parameters:
settings
- a settings object for settings that has a default value depending on another setting if available
-
getDefault
Returns the default value for this setting.- Parameters:
settings
- a settings object for settings that has a default value depending on another setting if available
-
exists
Returns true if and only if this setting is present in the given settings instance. Note that fallback settings are excluded.- Parameters:
settings
- the settings- Returns:
- true if the setting is present in the given settings instance, otherwise false
-
existsOrFallbackExists
Returns true if and only if this setting including fallback settings is present in the given settings instance.- Parameters:
settings
- the settings- Returns:
- true if the setting including fallback settings is present in the given settings instance, otherwise false
-
get
Returns the settings value. If the setting is not present in the given settings object the default value is returned instead. -
diff
Add this setting to the builder if it doesn't exists in the source settings. The value added to the builder is taken from the given default settings object.- Parameters:
builder
- the settings builder to fill the diff intosource
- the source settings object to diffdefaultSettings
- the default settings object to diff against
-
match
public final boolean match(java.lang.String toTest)Returnstrue
iff the given key matches the settings key or if this setting is a group setting if the given key is part of the settings group.- See Also:
isGroupSetting()
-
toXContent
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
get
Returns the value for this setting but falls back to the second provided settings object -
getConcreteSetting
-
getSettingsDependencies
Returns a set of settings that are required at validation time. Unless all of the dependencies are present in the settings object validation of setting must fail. -
versionSetting
public static Setting<Version> versionSetting(java.lang.String key, Version defaultValue, Setting.Property... properties) -
floatSetting
public static Setting<java.lang.Float> floatSetting(java.lang.String key, float defaultValue, Setting.Property... properties) -
floatSetting
public static Setting<java.lang.Float> floatSetting(java.lang.String key, float defaultValue, float minValue, Setting.Property... properties) -
intSetting
public static Setting<java.lang.Integer> intSetting(java.lang.String key, int defaultValue, int minValue, int maxValue, Setting.Property... properties) -
intSetting
public static Setting<java.lang.Integer> intSetting(java.lang.String key, int defaultValue, int minValue, Setting.Property... properties) -
intSetting
public static Setting<java.lang.Integer> intSetting(java.lang.String key, int defaultValue, int minValue, Setting.Validator<java.lang.Integer> validator, Setting.Property... properties) -
intSetting
public static Setting<java.lang.Integer> intSetting(java.lang.String key, Setting<java.lang.Integer> fallbackSetting, int minValue, Setting.Property... properties) -
intSetting
public static Setting<java.lang.Integer> intSetting(java.lang.String key, Setting<java.lang.Integer> fallbackSetting, int minValue, Setting.Validator<java.lang.Integer> validator, Setting.Property... properties) -
longSetting
public static Setting<java.lang.Long> longSetting(java.lang.String key, long defaultValue, long minValue, Setting.Property... properties) -
simpleString
public static Setting<java.lang.String> simpleString(java.lang.String key, Setting.Property... properties) -
simpleString
public static Setting<java.lang.String> simpleString(java.lang.String key, Setting.Validator<java.lang.String> validator, Setting.Property... properties) -
simpleString
public static Setting<java.lang.String> simpleString(java.lang.String key, Setting.Validator<java.lang.String> validator, Setting<java.lang.String> fallback, Setting.Property... properties) -
simpleString
public static Setting<java.lang.String> simpleString(java.lang.String key, java.lang.String defaultValue, Setting.Validator<java.lang.String> validator, Setting.Property... properties) -
simpleString
public static Setting<java.lang.String> simpleString(java.lang.String key, Setting<java.lang.String> fallback, Setting.Property... properties) -
simpleString
public static Setting<java.lang.String> simpleString(java.lang.String key, Setting<java.lang.String> fallback, java.util.function.Function<java.lang.String,java.lang.String> parser, Setting.Property... properties) -
simpleString
public static Setting<java.lang.String> simpleString(java.lang.String key, java.lang.String defaultValue, Setting.Property... properties)Creates a new Setting instance with a String value- Parameters:
key
- the settings key for this setting.defaultValue
- the default String value.properties
- properties for this setting like scope, filtering...- Returns:
- the Setting Object
-
parseInt
public static int parseInt(java.lang.String s, int minValue, java.lang.String key) -
parseInt
public static int parseInt(java.lang.String s, int minValue, java.lang.String key, boolean isFiltered) -
parseInt
public static int parseInt(java.lang.String s, int minValue, int maxValue, java.lang.String key) -
parseLong
public static long parseLong(java.lang.String s, long minValue, java.lang.String key) -
parseTimeValue
-
intSetting
public static Setting<java.lang.Integer> intSetting(java.lang.String key, int defaultValue, Setting.Property... properties) -
boolSetting
public static Setting<java.lang.Boolean> boolSetting(java.lang.String key, boolean defaultValue, Setting.Property... properties) -
boolSetting
public static Setting<java.lang.Boolean> boolSetting(java.lang.String key, Setting<java.lang.Boolean> fallbackSetting, Setting.Property... properties) -
boolSetting
public static Setting<java.lang.Boolean> boolSetting(java.lang.String key, Setting<java.lang.Boolean> fallbackSetting, Setting.Validator<java.lang.Boolean> validator, Setting.Property... properties) -
boolSetting
public static Setting<java.lang.Boolean> boolSetting(java.lang.String key, boolean defaultValue, Setting.Validator<java.lang.Boolean> validator, Setting.Property... properties) -
boolSetting
public static Setting<java.lang.Boolean> boolSetting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValueFn, Setting.Property... properties) -
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(java.lang.String key, ByteSizeValue value, Setting.Property... properties) -
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(java.lang.String key, Setting<ByteSizeValue> fallbackSetting, Setting.Property... properties) -
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValue, Setting.Property... properties) -
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(java.lang.String key, ByteSizeValue defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, Setting.Property... properties) -
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, Setting.Property... properties) -
parseByteSize
public static ByteSizeValue parseByteSize(java.lang.String s, ByteSizeValue minValue, ByteSizeValue maxValue, java.lang.String key) -
memorySizeSetting
public static Setting<ByteSizeValue> memorySizeSetting(java.lang.String key, ByteSizeValue defaultValue, Setting.Property... properties)Creates a setting which specifies a memory size. This can either be specified as an absolute bytes value or as a percentage of the heap memory.- Parameters:
key
- the key for the settingdefaultValue
- the default value for this settingproperties
- properties properties for this setting like scope, filtering...- Returns:
- the setting object
-
memorySizeSetting
public static Setting<ByteSizeValue> memorySizeSetting(java.lang.String key, java.util.function.Function<Settings,java.lang.String> defaultValue, Setting.Property... properties)Creates a setting which specifies a memory size. This can either be specified as an absolute bytes value or as a percentage of the heap memory.- Parameters:
key
- the key for the settingdefaultValue
- a function that supplies the default value for this settingproperties
- properties properties for this setting like scope, filtering...- Returns:
- the setting object
-
memorySizeSetting
public static Setting<ByteSizeValue> memorySizeSetting(java.lang.String key, java.lang.String defaultPercentage, Setting.Property... properties)Creates a setting which specifies a memory size. This can either be specified as an absolute bytes value or as a percentage of the heap memory.- Parameters:
key
- the key for the settingdefaultPercentage
- the default value of this setting as a percentage of the heap memoryproperties
- properties properties for this setting like scope, filtering...- Returns:
- the setting object
-
listSetting
public static <T> Setting<java.util.List<T>> listSetting(java.lang.String key, java.util.List<java.lang.String> defaultStringValue, java.util.function.Function<java.lang.String,T> singleValueParser, Setting.Property... properties) -
listSetting
public static <T> Setting<java.util.List<T>> listSetting(java.lang.String key, java.util.List<java.lang.String> defaultStringValue, java.util.function.Function<java.lang.String,T> singleValueParser, Setting.Validator<java.util.List<T>> validator, Setting.Property... properties) -
listSetting
public static <T> Setting<java.util.List<T>> listSetting(java.lang.String key, Setting<java.util.List<T>> fallbackSetting, java.util.function.Function<java.lang.String,T> singleValueParser, Setting.Property... properties) -
listSetting
public static <T> Setting<java.util.List<T>> listSetting(java.lang.String key, java.util.function.Function<java.lang.String,T> singleValueParser, java.util.function.Function<Settings,java.util.List<java.lang.String>> defaultStringValue, Setting.Property... properties) -
listSetting
public static <T> Setting<java.util.List<T>> listSetting(java.lang.String key, java.util.function.Function<java.lang.String,T> singleValueParser, java.util.function.Function<Settings,java.util.List<java.lang.String>> defaultStringValue, Setting.Validator<java.util.List<T>> validator, Setting.Property... properties) -
listSetting
public static <T> Setting<java.util.List<T>> listSetting(java.lang.String key, @Nullable Setting<java.util.List<T>> fallbackSetting, java.util.function.Function<java.lang.String,T> singleValueParser, java.util.function.Function<Settings,java.util.List<java.lang.String>> defaultStringValue, Setting.Property... properties) -
listSetting
public static <T> Setting<java.util.List<T>> listSetting(java.lang.String key, @Nullable Setting<java.util.List<T>> fallbackSetting, java.util.function.Function<java.lang.String,T> singleValueParser, java.util.function.Function<Settings,java.util.List<java.lang.String>> defaultStringValue, Setting.Validator<java.util.List<T>> validator, Setting.Property... properties) -
groupSetting
-
groupSetting
public static Setting<Settings> groupSetting(java.lang.String key, java.util.function.Consumer<Settings> validator, Setting.Property... properties) -
timeSetting
-
timeSetting
-
timeSetting
-
timeSetting
public static Setting<TimeValue> timeSetting(java.lang.String key, TimeValue defaultValue, TimeValue minValue, Setting.Property... properties) -
timeSetting
public static Setting<TimeValue> timeSetting(java.lang.String key, TimeValue defaultValue, Setting.Property... properties) -
timeSetting
public static Setting<TimeValue> timeSetting(java.lang.String key, Setting<TimeValue> fallbackSetting, Setting.Property... properties) -
timeSetting
public static Setting<TimeValue> timeSetting(java.lang.String key, Setting<TimeValue> fallBackSetting, Setting.Validator<TimeValue> validator, Setting.Property... properties) -
positiveTimeSetting
public static Setting<TimeValue> positiveTimeSetting(java.lang.String key, TimeValue defaultValue, Setting.Property... properties) -
positiveTimeSetting
-
doubleSetting
public static Setting<java.lang.Double> doubleSetting(java.lang.String key, double defaultValue, double minValue, Setting.Property... properties) -
doubleSetting
public static Setting<java.lang.Double> doubleSetting(java.lang.String key, double defaultValue, double minValue, double maxValue, Setting.Property... properties) -
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
prefixKeySetting
public static <T> Setting.AffixSetting<T> prefixKeySetting(java.lang.String prefix, java.util.function.Function<java.lang.String,Setting<T>> delegateFactory)This setting type allows to validate settings that have the same type and a common prefix. For instance feature.${type}=[true|false] can easily be added with this setting. Yet, prefix key settings don't support updaters out of the box unlessgetConcreteSetting(String)
is used to pull the updater. -
affixKeySetting
public static <T> Setting.AffixSetting<T> affixKeySetting(java.lang.String prefix, java.lang.String suffix, java.util.function.Function<java.lang.String,Setting<T>> delegateFactory, Setting.AffixSettingDependency... dependencies)This setting type allows to validate settings that have the same type and a common prefix and suffix. For instance storage.${backend}.enable=[true|false] can easily be added with this setting. Yet, affix key settings don't support updaters out of the box unlessgetConcreteSetting(String)
is used to pull the updater. -
affixKeySetting
public static <T> Setting.AffixSetting<T> affixKeySetting(java.lang.String prefix, java.lang.String suffix, java.util.function.BiFunction<java.lang.String,java.lang.String,Setting<T>> delegateFactory, Setting.AffixSettingDependency... dependencies)
-