Class Settings.Builder
java.lang.Object
org.elasticsearch.common.settings.Settings.Builder
- Enclosing class:
- Settings
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()
Returns a setting value based on the setting key.Return the current secure settings, ornull
if none have been set.keys()
loadFromMap(Map<String,?> map)
Loads settings from a map.loadFromPath(Path path)
Loads settings from a url that represents them usingSettings.fromXContent(XContentParser)
Note: Loading from a path doesn't allownull
values in the incoming xcontentloadFromSource(String source, org.elasticsearch.common.xcontent.XContentType xContentType)
Loads settings from the actual string content that represents them usingSettings.fromXContent(XContentParser)
loadFromStream(String resourceName, InputStream is, boolean acceptNullValues)
Loads settings from a stream that represents them usingSettings.fromXContent(XContentParser)
normalizePrefix(String prefix)
Checks that all settings in the builder start with the specified prefix.Sets the setting with the provided setting key and the boolean value.Sets the setting with the provided setting key and the double value.Sets the setting with the provided setting key and the float value.Sets the setting with the provided setting key and the int value.Sets the setting with the provided setting key and the long value.Sets the setting with the provided setting key and the time value.put(String setting, long value, ByteSizeUnit sizeUnit)
Sets the setting with the provided setting key and the size value.Sets an enum setting with the provided setting key and enum instance.Sets a setting with the provided setting key and value.Sets a path setting with the provided setting key and path.Sets an level setting with the provided setting key and level instance.Sets an lucene version setting with the provided setting key and lucene version instance.put(String key, ByteSizeValue byteSizeValue)
Sets a byteSizeValue setting with the provided setting key and byteSizeValue.Sets a time value setting with the provided setting key and value.Sets all the provided settings including secure settingsSets all the provided settings.Sets the setting with the provided setting key and an array of values.Sets the setting with the provided setting key and a list of values.Sets a null value for the given setting keyRemoves 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)
-
Field Details
-
EMPTY_SETTINGS
-
-
Method Details
-
keys
-
remove
Removes the provided setting from the internal map holding the current list of settings. -
get
Returns a setting value based on the setting key. -
getSecureSettings
Return the current secure settings, ornull
if none have been set. -
setSecureSettings
-
put
Sets a path setting with the provided setting key and path.- Parameters:
key
- The setting keypath
- The setting path- Returns:
- The builder
-
put
Sets a time value setting with the provided setting key and value.- Parameters:
key
- The setting keytimeValue
- The setting timeValue- Returns:
- The builder
-
put
Sets a byteSizeValue setting with the provided setting key and byteSizeValue.- Parameters:
key
- The setting keybyteSizeValue
- The setting value- Returns:
- The builder
-
put
Sets an enum setting with the provided setting key and enum instance.- Parameters:
key
- The setting keyenumValue
- The setting value- Returns:
- The builder
-
put
Sets an level setting with the provided setting key and level instance.- Parameters:
key
- The setting keylevel
- The setting value- Returns:
- The builder
-
put
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
Sets a setting with the provided setting key and value.- Parameters:
key
- The setting keyvalue
- The setting value- Returns:
- The builder
-
copy
-
copy
-
putNull
Sets a null value for the given setting key -
put
Sets the setting with the provided setting key and the boolean value.- Parameters:
setting
- The setting keyvalue
- The boolean value- Returns:
- The builder
-
put
Sets the setting with the provided setting key and the int value.- Parameters:
setting
- The setting keyvalue
- The int value- Returns:
- The builder
-
put
-
put
Sets the setting with the provided setting key and the long value.- Parameters:
setting
- The setting keyvalue
- The long value- Returns:
- The builder
-
put
Sets the setting with the provided setting key and the float value.- Parameters:
setting
- The setting keyvalue
- The float value- Returns:
- The builder
-
put
Sets the setting with the provided setting key and the double value.- Parameters:
setting
- The setting keyvalue
- The double value- Returns:
- The builder
-
put
Sets the setting with the provided setting key and the time value.- Parameters:
setting
- The setting keyvalue
- The time value- Returns:
- The builder
-
put
Sets the setting with the provided setting key and the size value.- Parameters:
setting
- The setting keyvalue
- The size value- Returns:
- The builder
-
putList
Sets the setting with the provided setting key and an array of values.- Parameters:
setting
- The setting keyvalues
- The values- Returns:
- The builder
-
putList
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
Loads settings from a map. -
loadFromSource
public Settings.Builder loadFromSource(String source, org.elasticsearch.common.xcontent.XContentType xContentType)Loads settings from the actual string content that represents them usingSettings.fromXContent(XContentParser)
-
loadFromPath
Loads settings from a url that represents them usingSettings.fromXContent(XContentParser)
Note: Loading from a path doesn't allownull
values in the incoming xcontent- Throws:
IOException
-
loadFromStream
public Settings.Builder loadFromStream(String resourceName, InputStream is, boolean acceptNullValues) throws IOExceptionLoads settings from a stream that represents them usingSettings.fromXContent(XContentParser)
- Throws:
IOException
-
putProperties
-
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
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
-