Class Setting<T>
java.lang.Object
org.elasticsearch.common.settings.Setting<T>
- All Implemented Interfaces:
org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
- Direct Known Subclasses:
SecureSetting
,Setting.AffixSetting
public class Setting<T>
extends Object
implements org.elasticsearch.common.xcontent.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
Modifier and TypeClassDescriptionstatic class
A key that allows for static pre and suffix.static class
static interface
Allows an affix setting to declare a dependency on another affix setting.static class
static interface
static class
static class
static interface
Allows a setting to declare a dependency on another setting being set.static class
static interface
Represents a validator for a setting.Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
-
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionCreates a new Setting instanceSetting(String key, String defaultValue, Function<String,T> parser, Setting.Validator<T> validator, Setting.Property... properties)
Creates a newSetting
instance.Setting(String key, Function<Settings,String> defaultValue, Function<String,T> parser, Setting.Property... properties)
Creates a new Setting instanceSetting(String key, Setting<T> fallBackSetting, Function<String,T> parser, Setting.Property... properties)
Creates a new Setting instanceSetting(String key, Setting<T> fallbackSetting, Function<String,T> parser, Setting.Validator<T> validator, Setting.Property... properties)
Creates a new Setting instanceSetting(Setting.Key key, Function<Settings,String> defaultValue, Function<String,T> parser, Setting.Property... properties)
Creates a new Setting instanceSetting(Setting.Key key, Function<Settings,String> defaultValue, Function<String,T> parser, Setting.Validator<T> validator, Setting.Property... properties)
Creates a newSetting
instance.Setting(Setting.Key key, Setting<T> fallbackSetting, Function<String,T> parser, Setting.Property... properties)
Creates a new Setting instance -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Setting.AffixSetting<T>
affixKeySetting(String prefix, String suffix, BiFunction<String,String,Setting<T>> delegateFactory, Setting.AffixSettingDependency... dependencies)
static <T> Setting.AffixSetting<T>
affixKeySetting(String prefix, String suffix, Function<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.boolSetting(String key, boolean defaultValue, Setting.Property... properties)
boolSetting(String key, boolean defaultValue, Setting.Validator<Boolean> validator, Setting.Property... properties)
boolSetting(String key, Function<Settings,String> defaultValueFn, Setting.Property... properties)
boolSetting(String key, Setting<Boolean> fallbackSetting, Setting.Property... properties)
boolSetting(String key, Setting<Boolean> fallbackSetting, Setting.Validator<Boolean> validator, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(String key, Function<Settings,String> defaultValue, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(String key, Function<Settings,String> defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(String key, Setting<ByteSizeValue> fallbackSetting, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(String key, ByteSizeValue value, Setting.Property... properties)
static Setting<ByteSizeValue>
byteSizeSetting(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.doubleSetting(String key, double defaultValue, double minValue, double maxValue, Setting.Property... properties)
doubleSetting(String key, double defaultValue, double minValue, Setting.Property... properties)
enumSetting(Class<T> clazz, String key, Setting<T> fallbackSetting, Setting.Validator<T> validator, Setting.Property... properties)
Creates a setting where the allowed values are defined as enum constants.enumSetting(Class<T> clazz, String key, T defaultValue, Setting.Property... properties)
Creates a setting where the allowed values are defined as enum constants.boolean
boolean
Returns true if and only if this setting is present in the given settings instance.boolean
exists(Settings.Builder builder)
boolean
existsOrFallbackExists(Settings settings)
Returns true if and only if this setting including fallback settings is present in the given settings instance.floatSetting(String key, float defaultValue, float minValue, Setting.Property... properties)
floatSetting(String key, float defaultValue, Setting.Property... properties)
Returns the settings value.Returns the value for this setting but falls back to the second provided settings objectgetConcreteSetting(String key)
getDefault(Settings settings)
Returns the default value for this setting.getDefaultRaw(Settings settings)
Returns the default value string representation for this setting.getKey()
Returns the settings key or a prefix if this setting is a group setting.Returns the setting propertiesReturns the original representation of a setting key.Returns a set of settings that are required at validation time.groupSetting(String key, Consumer<Settings> validator, Setting.Property... properties)
groupSetting(String key, Setting.Property... properties)
int
hashCode()
boolean
Returnstrue
if this setting has an index scope, otherwisefalse
boolean
Returnstrue
if this setting has a node scope, otherwisefalse
intSetting(String key, int defaultValue, int minValue, int maxValue, Setting.Property... properties)
intSetting(String key, int defaultValue, int minValue, Setting.Property... properties)
intSetting(String key, int defaultValue, int minValue, Setting.Validator<Integer> validator, Setting.Property... properties)
intSetting(String key, int defaultValue, Setting.Property... properties)
intSetting(String key, Setting<Integer> fallbackSetting, int minValue, int maxValue, Setting.Property... properties)
intSetting(String key, Setting<Integer> fallbackSetting, int minValue, Setting.Property... properties)
intSetting(String key, Setting<Integer> fallbackSetting, int minValue, Setting.Validator<Integer> validator, Setting.Property... properties)
boolean
Returnstrue
if this setting's value can be checked for equality across all nodes.boolean
Returnstrue
if this setting is deprecated, otherwisefalse
boolean
Returnstrue
if this setting is dynamically updateable, otherwisefalse
boolean
Returnstrue
if this setting must be filtered, otherwisefalse
boolean
isFinal()
Returnstrue
if this setting is final, otherwisefalse
boolean
boolean
Returnstrue
if this setting is dynamically updateable by operators, otherwisefalse
boolean
boolean
Checks whether this is a secure setting.listSetting(String key, Function<String,T> singleValueParser, Function<Settings,List<String>> defaultStringValue, Setting.Property... properties)
listSetting(String key, Function<String,T> singleValueParser, Function<Settings,List<String>> defaultStringValue, Setting.Validator<List<T>> validator, Setting.Property... properties)
listSetting(String key, List<String> defaultStringValue, Function<String,T> singleValueParser, Setting.Property... properties)
listSetting(String key, List<String> defaultStringValue, Function<String,T> singleValueParser, Setting.Validator<List<T>> validator, Setting.Property... properties)
listSetting(String key, Setting<List<T>> fallbackSetting, Function<String,T> singleValueParser, Function<Settings,List<String>> defaultStringValue, Setting.Property... properties)
listSetting(String key, Setting<List<T>> fallbackSetting, Function<String,T> singleValueParser, Function<Settings,List<String>> defaultStringValue, Setting.Validator<List<T>> validator, Setting.Property... properties)
listSetting(String key, Setting<List<T>> fallbackSetting, Function<String,T> singleValueParser, Setting.Property... properties)
longSetting(String key, long defaultValue, long minValue, Setting.Property... properties)
boolean
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(String key, String defaultPercentage, Setting.Property... properties)
Creates a setting which specifies a memory size.static Setting<ByteSizeValue>
memorySizeSetting(String key, Function<Settings,String> defaultValue, Setting.Property... properties)
Creates a setting which specifies a memory size.static Setting<ByteSizeValue>
memorySizeSetting(String key, ByteSizeValue defaultValue, Setting.Property... properties)
Creates a setting which specifies a memory size.static ByteSizeValue
parseByteSize(String s, ByteSizeValue minValue, ByteSizeValue maxValue, String key)
static int
static int
static int
static int
static long
static org.elasticsearch.core.TimeValue
parseTimeValue(String s, org.elasticsearch.core.TimeValue minValue, String key)
static Setting<org.elasticsearch.core.TimeValue>
positiveTimeSetting(String key, Setting<org.elasticsearch.core.TimeValue> fallbackSetting, org.elasticsearch.core.TimeValue minValue, Setting.Property... properties)
static Setting<org.elasticsearch.core.TimeValue>
positiveTimeSetting(String key, org.elasticsearch.core.TimeValue defaultValue, Setting.Property... properties)
static <T> Setting.AffixSetting<T>
prefixKeySetting(String prefix, Function<String,Setting<T>> delegateFactory)
This setting type allows to validate settings that have the same type and a common prefix.simpleString(String key, String defaultValue, Setting.Property... properties)
Creates a new Setting instance with a String valuesimpleString(String key, String defaultValue, Setting.Validator<String> validator, Setting.Property... properties)
simpleString(String key, Setting.Property... properties)
simpleString(String key, Setting.Validator<String> validator, Setting.Property... properties)
simpleString(String key, Setting.Validator<String> validator, Setting<String> fallback, Setting.Property... properties)
simpleString(String key, Setting<String> fallback, Function<String,String> parser, Setting.Property... properties)
simpleString(String key, Setting<String> fallback, Setting.Property... properties)
static Setting<org.elasticsearch.core.TimeValue>
timeSetting(String key, Function<Settings,org.elasticsearch.core.TimeValue> defaultValue, org.elasticsearch.core.TimeValue minValue, Setting.Property... properties)
static Setting<org.elasticsearch.core.TimeValue>
timeSetting(String key, Setting<org.elasticsearch.core.TimeValue> fallbackSetting, Setting.Property... properties)
static Setting<org.elasticsearch.core.TimeValue>
timeSetting(String key, Setting<org.elasticsearch.core.TimeValue> fallBackSetting, Setting.Validator<org.elasticsearch.core.TimeValue> validator, Setting.Property... properties)
static Setting<org.elasticsearch.core.TimeValue>
timeSetting(String key, Setting<org.elasticsearch.core.TimeValue> fallbackSetting, org.elasticsearch.core.TimeValue minValue, Setting.Property... properties)
static Setting<org.elasticsearch.core.TimeValue>
timeSetting(String key, org.elasticsearch.core.TimeValue defaultValue, Setting.Property... properties)
static Setting<org.elasticsearch.core.TimeValue>
timeSetting(String key, org.elasticsearch.core.TimeValue defaultValue, org.elasticsearch.core.TimeValue minValue, Setting.Property... properties)
static Setting<org.elasticsearch.core.TimeValue>
timeSetting(String key, org.elasticsearch.core.TimeValue defaultValue, org.elasticsearch.core.TimeValue minValue, org.elasticsearch.core.TimeValue maxValue, Setting.Property... properties)
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
versionSetting(String key, Version defaultValue, Setting.Property... properties)
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentObject
isFragment
-
Field Details
-
defaultValue
-
-
Constructor Details
-
Setting
public Setting(Setting.Key key, Function<Settings,String> defaultValue, Function<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, Function<Settings,String> defaultValue, Function<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(String key, String defaultValue, Function<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(String key, String defaultValue, Function<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(String key, Function<Settings,String> defaultValue, Function<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(String key, Setting<T> fallbackSetting, Function<String,T> parser, Setting.Validator<T> validator, 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.validator
- aSetting.Validator
for validating this settingproperties
- properties for this setting like scope, filtering...
-
Setting
public Setting(Setting.Key key, Setting<T> fallbackSetting, Function<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(String key, Setting<T> fallBackSetting, Function<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
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
-
isOperatorOnly
public final boolean isOperatorOnly()Returnstrue
if this setting is dynamically updateable by operators, otherwisefalse
-
isFinal
public final boolean isFinal()Returnstrue
if this setting is final, otherwisefalse
-
isInternalIndex
public final boolean isInternalIndex() -
isPrivateIndex
public final boolean isPrivateIndex() -
isSecure
Checks whether this is a secure setting.- Parameters:
settings
- used to check whether this setting is secure- Returns:
- whether this is a secure setting.
-
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
-
exists
-
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
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 org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
IOException
-
toString
-
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(String key, Version defaultValue, Setting.Property... properties) -
floatSetting
public static Setting<Float> floatSetting(String key, float defaultValue, Setting.Property... properties) -
floatSetting
public static Setting<Float> floatSetting(String key, float defaultValue, float minValue, Setting.Property... properties) -
intSetting
public static Setting<Integer> intSetting(String key, int defaultValue, int minValue, int maxValue, Setting.Property... properties) -
intSetting
public static Setting<Integer> intSetting(String key, int defaultValue, int minValue, Setting.Property... properties) -
intSetting
public static Setting<Integer> intSetting(String key, int defaultValue, int minValue, Setting.Validator<Integer> validator, Setting.Property... properties) -
intSetting
-
intSetting
-
intSetting
public static Setting<Integer> intSetting(String key, Setting<Integer> fallbackSetting, int minValue, Setting.Validator<Integer> validator, Setting.Property... properties) -
longSetting
public static Setting<Long> longSetting(String key, long defaultValue, long minValue, Setting.Property... properties) -
simpleString
-
simpleString
public static Setting<String> simpleString(String key, Setting.Validator<String> validator, Setting.Property... properties) -
simpleString
public static Setting<String> simpleString(String key, Setting.Validator<String> validator, Setting<String> fallback, Setting.Property... properties) -
simpleString
public static Setting<String> simpleString(String key, String defaultValue, Setting.Validator<String> validator, Setting.Property... properties) -
simpleString
-
simpleString
-
simpleString
public static Setting<String> simpleString(String key, 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
-
parseInt
-
parseInt
-
parseInt
-
parseLong
-
parseTimeValue
-
intSetting
public static Setting<Integer> intSetting(String key, int defaultValue, Setting.Property... properties) -
boolSetting
public static Setting<Boolean> boolSetting(String key, boolean defaultValue, Setting.Property... properties) -
boolSetting
-
boolSetting
public static Setting<Boolean> boolSetting(String key, Setting<Boolean> fallbackSetting, Setting.Validator<Boolean> validator, Setting.Property... properties) -
boolSetting
public static Setting<Boolean> boolSetting(String key, boolean defaultValue, Setting.Validator<Boolean> validator, Setting.Property... properties) -
boolSetting
-
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(String key, ByteSizeValue value, Setting.Property... properties) -
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(String key, Setting<ByteSizeValue> fallbackSetting, Setting.Property... properties) -
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(String key, Function<Settings,String> defaultValue, Setting.Property... properties) -
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(String key, ByteSizeValue defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, Setting.Property... properties) -
byteSizeSetting
public static Setting<ByteSizeValue> byteSizeSetting(String key, Function<Settings,String> defaultValue, ByteSizeValue minValue, ByteSizeValue maxValue, Setting.Property... properties) -
parseByteSize
public static ByteSizeValue parseByteSize(String s, ByteSizeValue minValue, ByteSizeValue maxValue, String key) -
enumSetting
public static <T extends Enum<T>> Setting<T> enumSetting(Class<T> clazz, String key, T defaultValue, Setting.Property... properties)Creates a setting where the allowed values are defined as enum constants. All enum constants must be uppercase.- Type Parameters:
T
- the generics type parameter reflecting the actual type of the enum- Parameters:
clazz
- the enum classkey
- the key for the settingdefaultValue
- the default value for this settingproperties
- properties for this setting like scope, filtering...- Returns:
- the setting object
-
enumSetting
public static <T extends Enum<T>> Setting<T> enumSetting(Class<T> clazz, String key, Setting<T> fallbackSetting, Setting.Validator<T> validator, Setting.Property... properties)Creates a setting where the allowed values are defined as enum constants. All enum constants must be uppercase.- Type Parameters:
T
- the generics type parameter reflecting the actual type of the enum- Parameters:
clazz
- the enum classkey
- the key for the settingfallbackSetting
- the fallback setting for this settingvalidator
- validator for this settingproperties
- properties for this setting like scope, filtering...- Returns:
- the setting object
-
memorySizeSetting
public static Setting<ByteSizeValue> memorySizeSetting(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(String key, Function<Settings,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(String key, 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
-
listSetting
public static <T> Setting<List<T>> listSetting(String key, List<String> defaultStringValue, Function<String,T> singleValueParser, Setting.Validator<List<T>> validator, Setting.Property... properties) -
listSetting
-
listSetting
-
listSetting
-
listSetting
-
listSetting
-
groupSetting
-
groupSetting
-
timeSetting
public static Setting<org.elasticsearch.core.TimeValue> timeSetting(String key, Setting<org.elasticsearch.core.TimeValue> fallbackSetting, org.elasticsearch.core.TimeValue minValue, Setting.Property... properties) -
timeSetting
public static Setting<org.elasticsearch.core.TimeValue> timeSetting(String key, Function<Settings,org.elasticsearch.core.TimeValue> defaultValue, org.elasticsearch.core.TimeValue minValue, Setting.Property... properties) -
timeSetting
public static Setting<org.elasticsearch.core.TimeValue> timeSetting(String key, org.elasticsearch.core.TimeValue defaultValue, org.elasticsearch.core.TimeValue minValue, org.elasticsearch.core.TimeValue maxValue, Setting.Property... properties) -
timeSetting
public static Setting<org.elasticsearch.core.TimeValue> timeSetting(String key, org.elasticsearch.core.TimeValue defaultValue, org.elasticsearch.core.TimeValue minValue, Setting.Property... properties) -
timeSetting
public static Setting<org.elasticsearch.core.TimeValue> timeSetting(String key, org.elasticsearch.core.TimeValue defaultValue, Setting.Property... properties) -
timeSetting
public static Setting<org.elasticsearch.core.TimeValue> timeSetting(String key, Setting<org.elasticsearch.core.TimeValue> fallbackSetting, Setting.Property... properties) -
timeSetting
public static Setting<org.elasticsearch.core.TimeValue> timeSetting(String key, Setting<org.elasticsearch.core.TimeValue> fallBackSetting, Setting.Validator<org.elasticsearch.core.TimeValue> validator, Setting.Property... properties) -
positiveTimeSetting
public static Setting<org.elasticsearch.core.TimeValue> positiveTimeSetting(String key, org.elasticsearch.core.TimeValue defaultValue, Setting.Property... properties) -
positiveTimeSetting
public static Setting<org.elasticsearch.core.TimeValue> positiveTimeSetting(String key, Setting<org.elasticsearch.core.TimeValue> fallbackSetting, org.elasticsearch.core.TimeValue minValue, Setting.Property... properties) -
doubleSetting
public static Setting<Double> doubleSetting(String key, double defaultValue, double minValue, Setting.Property... properties) -
doubleSetting
public static Setting<Double> doubleSetting(String key, double defaultValue, double minValue, double maxValue, Setting.Property... properties) -
equals
-
hashCode
public int hashCode() -
prefixKeySetting
public static <T> Setting.AffixSetting<T> prefixKeySetting(String prefix, Function<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(String prefix, String suffix, Function<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(String prefix, String suffix, BiFunction<String,String,Setting<T>> delegateFactory, Setting.AffixSettingDependency... dependencies)
-