|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
@ThreadSafe public interface Settings
Immutable settings allowing to control the configuration.
Using ImmutableSettings.settingsBuilder()
in order to create a builder
which in turn can create an immutable implementation of settings.
ImmutableSettings
Nested Class Summary | |
---|---|
static interface |
Settings.Builder
A settings builder interface. |
Method Summary | ||
---|---|---|
java.lang.String |
get(java.lang.String setting)
Returns the setting value associated with the setting key. |
|
java.lang.String |
get(java.lang.String setting,
java.lang.String defaultValue)
Returns the setting value associated with the setting key. |
|
java.lang.String[] |
getAsArray(java.lang.String settingPrefix)
|
|
java.lang.String[] |
getAsArray(java.lang.String settingPrefix,
java.lang.String[] defaultArray)
The values associated with a setting prefix as an array. |
|
java.lang.Boolean |
getAsBoolean(java.lang.String setting,
java.lang.Boolean defaultValue)
Returns the setting value (as boolean) associated with the setting key. |
|
|
getAsClass(java.lang.String setting,
java.lang.Class<? extends T> defaultClazz)
Returns the setting value (as a class) associated with the setting key. |
|
|
getAsClass(java.lang.String setting,
java.lang.Class<? extends T> defaultClazz,
java.lang.String prefixPackage,
java.lang.String suffixClassName)
Returns the setting value (as a class) associated with the setting key. |
|
java.lang.Double |
getAsDouble(java.lang.String setting,
java.lang.Double defaultValue)
Returns the setting value (as double) associated with the setting key. |
|
java.lang.Float |
getAsFloat(java.lang.String setting,
java.lang.Float defaultValue)
Returns the setting value (as float) associated with the setting key. |
|
java.lang.Integer |
getAsInt(java.lang.String setting,
java.lang.Integer defaultValue)
Returns the setting value (as int) associated with the setting key. |
|
java.lang.Long |
getAsLong(java.lang.String setting,
java.lang.Long defaultValue)
Returns the setting value (as long) associated with the setting key. |
|
java.util.Map<java.lang.String,java.lang.String> |
getAsMap()
The settings as a Map . |
|
SizeValue |
getAsSize(java.lang.String setting,
SizeValue defaultValue)
Returns the setting value (as size) associated with the setting key. |
|
TimeValue |
getAsTime(java.lang.String setting,
TimeValue defaultValue)
Returns the setting value (as time) associated with the setting key. |
|
Settings |
getByPrefix(java.lang.String prefix)
A settings that are filtered (and key is removed) with the specified prefix. |
|
java.lang.ClassLoader |
getClassLoader()
The class loader associated with this settings. |
|
Settings |
getComponentSettings(java.lang.Class component)
Component settings for a specific component. |
|
Settings |
getComponentSettings(java.lang.String prefix,
java.lang.Class component)
Component settings for a specific component. |
|
Settings |
getGlobalSettings()
The global settings if these settings are group settings. |
|
java.util.Map<java.lang.String,Settings> |
getGroups(java.lang.String settingPrefix)
Returns group settings for the given setting prefix. |
Method Detail |
---|
Settings getGlobalSettings()
Settings getComponentSettings(java.lang.Class component)
Settings getComponentSettings(java.lang.String prefix, java.lang.Class component)
Settings getByPrefix(java.lang.String prefix)
java.lang.ClassLoader getClassLoader()
java.util.Map<java.lang.String,java.lang.String> getAsMap()
Map
.
java.lang.String get(java.lang.String setting)
setting
- The setting key
java.lang.String get(java.lang.String setting, java.lang.String defaultValue)
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
java.util.Map<java.lang.String,Settings> getGroups(java.lang.String settingPrefix) throws SettingsException
SettingsException
java.lang.Float getAsFloat(java.lang.String setting, java.lang.Float defaultValue) throws SettingsException
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
SettingsException
- Failure to parse the settingjava.lang.Double getAsDouble(java.lang.String setting, java.lang.Double defaultValue) throws SettingsException
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
SettingsException
- Failure to parse the settingjava.lang.Integer getAsInt(java.lang.String setting, java.lang.Integer defaultValue) throws SettingsException
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
SettingsException
- Failure to parse the settingjava.lang.Long getAsLong(java.lang.String setting, java.lang.Long defaultValue) throws SettingsException
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
SettingsException
- Failure to parse the settingjava.lang.Boolean getAsBoolean(java.lang.String setting, java.lang.Boolean defaultValue) throws SettingsException
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
SettingsException
- Failure to parse the settingTimeValue getAsTime(java.lang.String setting, TimeValue defaultValue) throws SettingsException
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
SettingsException
- Failure to parse the settingTimeValue.parseTimeValue(String, org.elasticsearch.util.TimeValue)
SizeValue getAsSize(java.lang.String setting, SizeValue defaultValue) throws SettingsException
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
SettingsException
- Failure to parse the settingSizeValue.parseSizeValue(String, SizeValue)
<T> java.lang.Class<? extends T> getAsClass(java.lang.String setting, java.lang.Class<? extends T> defaultClazz) throws NoClassSettingsException
T
- The type of the classsetting
- The setting keydefaultClazz
- The class to return if no value is associated with the setting
NoClassSettingsException
- Failure to load a class<T> java.lang.Class<? extends T> getAsClass(java.lang.String setting, java.lang.Class<? extends T> defaultClazz, java.lang.String prefixPackage, java.lang.String suffixClassName) throws NoClassSettingsException
T
- The type of the classsetting
- The setting keydefaultClazz
- The class to return if no value is associated with the settingprefixPackage
- The prefix package to prefix the value with if failing to load the class as issuffixClassName
- The suffix class name to prefix the value with if failing to load the class as is
NoClassSettingsException
- Failure to load the classjava.lang.String[] getAsArray(java.lang.String settingPrefix, java.lang.String[] defaultArray) throws SettingsException
settingPrefix
- The setting prefix to load the array by
SettingsException
java.lang.String[] getAsArray(java.lang.String settingPrefix) throws SettingsException
SettingsException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |