|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.common.settings.ImmutableSettings.Builder
public static class ImmutableSettings.Builder
A builder allowing to put different settings and then build()
an immutable
settings implementation. Use ImmutableSettings.settingsBuilder()
in order to
construct it.
Field Summary | |
---|---|
static Settings |
EMPTY_SETTINGS
|
Method Summary | |
---|---|
Settings |
build()
Builds a Settings (underlying uses ImmutableSettings ) based on everything
set on this builder. |
ImmutableSettings.Builder |
classLoader(ClassLoader classLoader)
Sets the class loader associated with the settings built. |
String |
get(String key)
Returns a setting value based on the setting key. |
Map<String,String> |
internalMap()
|
ImmutableSettings.Builder |
loadFromClasspath(String resourceName)
Loads settings from classpath that represents them using the SettingsLoaderFactory.loaderFromSource(String) . |
ImmutableSettings.Builder |
loadFromSource(String source)
Loads settings from the actual string content that represents them using the SettingsLoaderFactory.loaderFromSource(String) . |
ImmutableSettings.Builder |
loadFromStream(String resourceName,
InputStream is)
Loads settings from a stream that represents them using the SettingsLoaderFactory.loaderFromSource(String) . |
ImmutableSettings.Builder |
loadFromUrl(URL url)
Loads settings from a url that represents them using the SettingsLoaderFactory.loaderFromSource(String) . |
ImmutableSettings.Builder |
put(Map<String,String> settings)
Sets all the provided settings. |
ImmutableSettings.Builder |
put(Properties properties)
Sets all the provided settings. |
ImmutableSettings.Builder |
put(Settings settings)
Sets all the provided settings. |
ImmutableSettings.Builder |
put(String setting,
boolean value)
Sets the setting with the provided setting key and the boolean value. |
ImmutableSettings.Builder |
put(String key,
Class clazz)
Sets a setting with the provided setting key and class as value. |
ImmutableSettings.Builder |
put(String setting,
double value)
Sets the setting with the provided setting key and the double value. |
ImmutableSettings.Builder |
put(String setting,
float value)
Sets the setting with the provided setting key and the float value. |
ImmutableSettings.Builder |
put(String setting,
int value)
Sets the setting with the provided setting key and the int value. |
ImmutableSettings.Builder |
put(String setting,
long value)
Sets the setting with the provided setting key and the long value. |
ImmutableSettings.Builder |
put(String setting,
long value,
ByteSizeUnit sizeUnit)
Sets the setting with the provided setting key and the size value. |
ImmutableSettings.Builder |
put(String setting,
long value,
TimeUnit timeUnit)
Sets the setting with the provided setting key and the time value. |
ImmutableSettings.Builder |
put(String key,
String value)
Sets a setting with the provided setting key and value. |
ImmutableSettings.Builder |
put(String settingPrefix,
String groupName,
String[] settings,
String[] values)
Sets the setting group. |
ImmutableSettings.Builder |
put(String setting,
Version version)
|
ImmutableSettings.Builder |
putArray(String setting,
String... values)
Sets the setting with the provided setting key and an array of values. |
ImmutableSettings.Builder |
putProperties(String prefix,
Properties properties)
Puts all the properties with keys starting with the provided prefix. |
ImmutableSettings.Builder |
putProperties(String prefix,
Properties properties,
String[] ignorePrefixes)
Puts all the properties with keys starting with the provided prefix. |
String |
remove(String key)
Removes the provided setting from the internal map holding the current list of settings. |
ImmutableSettings.Builder |
replacePropertyPlaceholders()
Runs across all the settings set on this builder and replaces ${...} elements in the each setting value according to the following logic: |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Settings EMPTY_SETTINGS
Method Detail |
---|
public Map<String,String> internalMap()
public String remove(String key)
public String get(String key)
public ImmutableSettings.Builder put(String key, String value)
key
- The setting keyvalue
- The setting value
public ImmutableSettings.Builder put(String key, Class clazz)
key
- The setting keyclazz
- The setting class value
public ImmutableSettings.Builder put(String setting, boolean value)
setting
- The setting keyvalue
- The boolean value
public ImmutableSettings.Builder put(String setting, int value)
setting
- The setting keyvalue
- The int value
public ImmutableSettings.Builder put(String setting, Version version)
public ImmutableSettings.Builder put(String setting, long value)
setting
- The setting keyvalue
- The long value
public ImmutableSettings.Builder put(String setting, float value)
setting
- The setting keyvalue
- The float value
public ImmutableSettings.Builder put(String setting, double value)
setting
- The setting keyvalue
- The double value
public ImmutableSettings.Builder put(String setting, long value, TimeUnit timeUnit)
setting
- The setting keyvalue
- The time value
public ImmutableSettings.Builder put(String setting, long value, ByteSizeUnit sizeUnit)
setting
- The setting keyvalue
- The size value
public ImmutableSettings.Builder putArray(String setting, String... values)
setting
- The setting keyvalues
- The values
public ImmutableSettings.Builder put(String settingPrefix, String groupName, String[] settings, String[] values) throws SettingsException
SettingsException
public ImmutableSettings.Builder put(Settings settings)
public ImmutableSettings.Builder put(Map<String,String> settings)
public ImmutableSettings.Builder put(Properties properties)
public ImmutableSettings.Builder loadFromSource(String source)
SettingsLoaderFactory.loaderFromSource(String)
.
public ImmutableSettings.Builder loadFromUrl(URL url) throws SettingsException
SettingsLoaderFactory.loaderFromSource(String)
.
SettingsException
public ImmutableSettings.Builder loadFromStream(String resourceName, InputStream is) throws SettingsException
SettingsLoaderFactory.loaderFromSource(String)
.
SettingsException
public ImmutableSettings.Builder loadFromClasspath(String resourceName) throws SettingsException
SettingsLoaderFactory.loaderFromSource(String)
.
SettingsException
public ImmutableSettings.Builder classLoader(ClassLoader classLoader)
public ImmutableSettings.Builder putProperties(String prefix, Properties properties)
prefix
- The prefix to filter property key byproperties
- The properties to put
public ImmutableSettings.Builder putProperties(String prefix, Properties properties, String[] ignorePrefixes)
prefix
- The prefix to filter property key byproperties
- The properties to put
public ImmutableSettings.Builder replacePropertyPlaceholders()
First, tries to resolve it against a System property (System.getProperty(String)
), next,
tries and resolve it against an environment variable (System.getenv(String)
), and last, tries
and replace it with another setting already set on this builder.
public Settings build()
Settings
(underlying uses ImmutableSettings
) based on everything
set on this builder.
build
in interface Settings.Builder
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |