|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.common.settings.ImmutableSettings
public class ImmutableSettings
An immutable implementation of Settings
.
Nested Class Summary | |
---|---|
static class |
ImmutableSettings.Builder
A builder allowing to put different settings and then ImmutableSettings.Builder.build() an immutable
settings implementation. |
Method Summary | ||
---|---|---|
boolean |
equals(Object o)
|
|
String |
get(String setting)
Returns the setting value associated with the setting key. |
|
String |
get(String setting,
String defaultValue)
Returns the setting value associated with the setting key. |
|
String[] |
getAsArray(String settingPrefix)
The values associated with a setting prefix as an array. |
|
String[] |
getAsArray(String settingPrefix,
String[] defaultArray)
The values associated with a setting prefix as an array. |
|
Boolean |
getAsBoolean(String setting,
Boolean defaultValue)
Returns the setting value (as boolean) associated with the setting key. |
|
ByteSizeValue |
getAsBytesSize(String setting,
ByteSizeValue defaultValue)
Returns the setting value (as size) associated with the setting key. |
|
|
getAsClass(String setting,
Class<? extends T> defaultClazz)
Returns the setting value (as a class) associated with the setting key. |
|
|
getAsClass(String setting,
Class<? extends T> defaultClazz,
String prefixPackage,
String suffixClassName)
Returns the setting value (as a class) associated with the setting key. |
|
Double |
getAsDouble(String setting,
Double defaultValue)
Returns the setting value (as double) associated with the setting key. |
|
Float |
getAsFloat(String setting,
Float defaultValue)
Returns the setting value (as float) associated with the setting key. |
|
Integer |
getAsInt(String setting,
Integer defaultValue)
Returns the setting value (as int) associated with the setting key. |
|
Long |
getAsLong(String setting,
Long defaultValue)
Returns the setting value (as long) associated with the setting key. |
|
com.google.common.collect.ImmutableMap<String,String> |
getAsMap()
The settings as a Map . |
|
SizeValue |
getAsSize(String setting,
SizeValue defaultValue)
Returns the setting value (as size) associated with the setting key. |
|
TimeValue |
getAsTime(String setting,
TimeValue defaultValue)
Returns the setting value (as time) associated with the setting key. |
|
Version |
getAsVersion(String setting,
Version defaultVersion)
Retruns a parsed version. |
|
Settings |
getByPrefix(String prefix)
A settings that are filtered (and key is removed) with the specified prefix. |
|
ClassLoader |
getClassLoader()
The class loader associated with this settings, or Classes.getDefaultClassLoader()
if not set. |
|
ClassLoader |
getClassLoaderIfSet()
The class loader associated with this settings, but only if explicitly set, otherwise null. |
|
Settings |
getComponentSettings(Class component)
Component settings for a specific component. |
|
Settings |
getComponentSettings(String prefix,
Class component)
Component settings for a specific component. |
|
Map<String,Settings> |
getGroups(String settingPrefix)
Returns group settings for the given setting prefix. |
|
int |
hashCode()
|
|
static Settings |
readSettingsFromStream(StreamInput in)
|
|
static ImmutableSettings.Builder |
settingsBuilder()
Returns a builder to be used in order to build settings. |
|
static void |
writeSettingsToStream(Settings settings,
StreamOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public ClassLoader getClassLoader()
Settings
Classes.getDefaultClassLoader()
if not set.
getClassLoader
in interface Settings
public ClassLoader getClassLoaderIfSet()
Settings
getClassLoaderIfSet
in interface Settings
public com.google.common.collect.ImmutableMap<String,String> getAsMap()
Settings
Map
.
getAsMap
in interface Settings
public Settings getComponentSettings(Class component)
Settings
getComponentSettings
in interface Settings
public Settings getComponentSettings(String prefix, Class component)
Settings
getComponentSettings
in interface Settings
public Settings getByPrefix(String prefix)
Settings
getByPrefix
in interface Settings
public String get(String setting)
Settings
get
in interface Settings
setting
- The setting key
public String get(String setting, String defaultValue)
Settings
get
in interface Settings
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
public Float getAsFloat(String setting, Float defaultValue)
Settings
getAsFloat
in interface Settings
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
public Double getAsDouble(String setting, Double defaultValue)
Settings
getAsDouble
in interface Settings
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
public Integer getAsInt(String setting, Integer defaultValue)
Settings
getAsInt
in interface Settings
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
public Long getAsLong(String setting, Long defaultValue)
Settings
getAsLong
in interface Settings
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
public Boolean getAsBoolean(String setting, Boolean defaultValue)
Settings
getAsBoolean
in interface Settings
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
public TimeValue getAsTime(String setting, TimeValue defaultValue)
Settings
getAsTime
in interface Settings
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
TimeValue.parseTimeValue(String, org.elasticsearch.common.unit.TimeValue)
public ByteSizeValue getAsBytesSize(String setting, ByteSizeValue defaultValue) throws SettingsException
Settings
getAsBytesSize
in interface Settings
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
SettingsException
- Failure to parse the settingByteSizeValue.parseBytesSizeValue(String, org.elasticsearch.common.unit.ByteSizeValue)
public SizeValue getAsSize(String setting, SizeValue defaultValue) throws SettingsException
Settings
getAsSize
in interface Settings
setting
- The setting keydefaultValue
- The value to return if no value is associated with the setting
SettingsException
- Failure to parse the settingByteSizeValue.parseBytesSizeValue(String, org.elasticsearch.common.unit.ByteSizeValue)
public <T> Class<? extends T> getAsClass(String setting, Class<? extends T> defaultClazz) throws NoClassSettingsException
Settings
getAsClass
in interface Settings
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 classpublic <T> Class<? extends T> getAsClass(String setting, Class<? extends T> defaultClazz, String prefixPackage, String suffixClassName) throws NoClassSettingsException
Settings
getAsClass
in interface Settings
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 classpublic String[] getAsArray(String settingPrefix) throws SettingsException
Settings
It will also automatically load a comma separated list under the settingPrefix and merge with the numbered format.
getAsArray
in interface Settings
settingPrefix
- The setting prefix to load the array by
SettingsException
public String[] getAsArray(String settingPrefix, String[] defaultArray) throws SettingsException
Settings
It will also automatically load a comma separated list under the settingPrefix and merge with the numbered format.
getAsArray
in interface Settings
settingPrefix
- The setting prefix to load the array by
SettingsException
public Map<String,Settings> getGroups(String settingPrefix) throws SettingsException
Settings
getGroups
in interface Settings
SettingsException
public Version getAsVersion(String setting, Version defaultVersion) throws SettingsException
Settings
getAsVersion
in interface Settings
SettingsException
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public static Settings readSettingsFromStream(StreamInput in) throws IOException
IOException
public static void writeSettingsToStream(Settings settings, StreamOutput out) throws IOException
IOException
public static ImmutableSettings.Builder settingsBuilder()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |