Class Settings.Builder
org.elasticsearch.common.settings.Settings.Builder
- Enclosing class:
- Settings
public static class Settings.Builder
extends
A builder allowing to put different settings and then
build()
an immutable
settings implementation. Use Settings.builder()
in order to
construct it.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
key, sourceKey, Settings source)
key, Settings source)
key)
Returns a setting value based on the setting key.Return the current secure settings, ornull
if none have been set.<>
keys()
<,?> map)
Loads settings from a map.path)
Loads settings from a url that represents them usingSettings.fromXContent(XContentParser)
Note: Loading from a path doesn't allownull
values in the incoming xcontentsource, org.elasticsearch.common.xcontent.XContentType xContentType)
Loads settings from the actual string content that represents them usingSettings.fromXContent(XContentParser)
resourceName, is, boolean acceptNullValues)
Loads settings from a stream that represents them usingSettings.fromXContent(XContentParser)
prefix)
Checks that all settings in the builder start with the specified prefix.setting, boolean value)
Sets the setting with the provided setting key and the boolean value.setting, double value)
Sets the setting with the provided setting key and the double value.setting, float value)
Sets the setting with the provided setting key and the float value.setting, int value)
Sets the setting with the provided setting key and the int value.setting, long value)
Sets the setting with the provided setting key and the long value.setting, long value, timeUnit)
Sets the setting with the provided setting key and the time value.setting, long value, ByteSizeUnit sizeUnit)
Sets the setting with the provided setting key and the size value.key, <?> enumValue)
Sets an enum setting with the provided setting key and enum instance.key, value)
Sets a setting with the provided setting key and value.key, path)
Sets a path setting with the provided setting key and path.key, org.apache.logging.log4j.Level level)
Sets an level setting with the provided setting key and level instance.key, org.apache.lucene.util.Version luceneVersion)
Sets an lucene version setting with the provided setting key and lucene version instance.key, ByteSizeValue byteSizeValue)
Sets a byteSizeValue setting with the provided setting key and byteSizeValue.key, org.elasticsearch.core.TimeValue timeValue)
Sets a time value setting with the provided setting key and value.setting, Version version)
Sets all the provided settings including secure settingsSets all the provided settings.setting, ... values)
Sets the setting with the provided setting key and an array of values.setting, <> values)
Sets the setting with the provided setting key and a list of values.key)
Sets a null value for the given setting key<,> esSettings, <,> keyFunction)
key)
Removes the provided setting from the internal map holding the current list of settings.Runs across all the settings set on this builder and replaces${...}
elements in each setting with another setting already set on this builder.setSecureSettings(SecureSettings secureSettings)
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
EMPTY_SETTINGS
-
-
Method Details
-
keys
public <> keys() -
remove
public remove( key)Removes the provided setting from the internal map holding the current list of settings. -
get
public get( key)Returns a setting value based on the setting key. -
getSecureSettings
Return the current secure settings, ornull
if none have been set. -
setSecureSettings
-
put
public key, path)Sets a path setting with the provided setting key and path.- Parameters:
key
- The setting keypath
- The setting path- Returns:
- The builder
-
put
public key, org.elasticsearch.core.TimeValue timeValue)Sets a time value setting with the provided setting key and value.- Parameters:
key
- The setting keytimeValue
- The setting timeValue- Returns:
- The builder
-
put
public key, ByteSizeValue byteSizeValue)Sets a byteSizeValue setting with the provided setting key and byteSizeValue.- Parameters:
key
- The setting keybyteSizeValue
- The setting value- Returns:
- The builder
-
put
public key, <?> enumValue)Sets an enum setting with the provided setting key and enum instance.- Parameters:
key
- The setting keyenumValue
- The setting value- Returns:
- The builder
-
put
public key, org.apache.logging.log4j.Level level)Sets an level setting with the provided setting key and level instance.- Parameters:
key
- The setting keylevel
- The setting value- Returns:
- The builder
-
put
public key, org.apache.lucene.util.Version luceneVersion)Sets an lucene version setting with the provided setting key and lucene version instance.- Parameters:
key
- The setting keyluceneVersion
- The setting value- Returns:
- The builder
-
put
public key, value)Sets a setting with the provided setting key and value.- Parameters:
key
- The setting keyvalue
- The setting value- Returns:
- The builder
-
copy
public key, Settings source) -
copy
public key, sourceKey, Settings source) -
putNull
public key)Sets a null value for the given setting key -
put
public setting, boolean value)Sets the setting with the provided setting key and the boolean value.- Parameters:
setting
- The setting keyvalue
- The boolean value- Returns:
- The builder
-
put
public setting, int value)Sets the setting with the provided setting key and the int value.- Parameters:
setting
- The setting keyvalue
- The int value- Returns:
- The builder
-
put
public setting, Version version) -
put
public setting, long value)Sets the setting with the provided setting key and the long value.- Parameters:
setting
- The setting keyvalue
- The long value- Returns:
- The builder
-
put
public setting, float value)Sets the setting with the provided setting key and the float value.- Parameters:
setting
- The setting keyvalue
- The float value- Returns:
- The builder
-
put
public setting, double value)Sets the setting with the provided setting key and the double value.- Parameters:
setting
- The setting keyvalue
- The double value- Returns:
- The builder
-
put
public setting, long value, timeUnit)Sets the setting with the provided setting key and the time value.- Parameters:
setting
- The setting keyvalue
- The time value- Returns:
- The builder
-
put
public setting, long value, ByteSizeUnit sizeUnit)Sets the setting with the provided setting key and the size value.- Parameters:
setting
- The setting keyvalue
- The size value- Returns:
- The builder
-
putList
public setting, ... values)Sets the setting with the provided setting key and an array of values.- Parameters:
setting
- The setting keyvalues
- The values- Returns:
- The builder
-
putList
public setting, <> values)Sets the setting with the provided setting key and a list of values.- Parameters:
setting
- The setting keyvalues
- The values- Returns:
- The builder
-
put
Sets all the provided settings including secure settings -
put
Sets all the provided settings.- Parameters:
settings
- the settings to setcopySecureSettings
- iftrue
all settings including secure settings are copied.
-
loadFromMap
public <,?> map)Loads settings from a map. -
loadFromSource
public source, org.elasticsearch.common.xcontent.XContentType xContentType)Loads settings from the actual string content that represents them usingSettings.fromXContent(XContentParser)
-
loadFromPath
public path) throwsLoads settings from a url that represents them usingSettings.fromXContent(XContentParser)
Note: Loading from a path doesn't allownull
values in the incoming xcontent- Throws:
-
loadFromStream
public resourceName, is, boolean acceptNullValues) throwsLoads settings from a stream that represents them usingSettings.fromXContent(XContentParser)
- Throws:
-
putProperties
public <,> esSettings, <,> keyFunction) -
replacePropertyPlaceholders
Runs across all the settings set on this builder and replaces${...}
elements in each setting with another setting already set on this builder. -
normalizePrefix
public prefix)Checks that all settings in the builder start with the specified prefix. If a setting doesn't start with the prefix, the builder appends the prefix to such setting. -
build
-