| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableSettings.Builder
A builder allowing to put different settings and then
ImmutableSettings.Builder.build() an immutable
settings implementation. |
static class |
ImmutableSettings.YamlSettingsLoader |
| Modifier and Type | Method and Description |
|---|---|
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.
|
<T> Class<? extends T> |
getAsClass(String setting,
Class<? extends T> defaultClazz)
Returns the setting value (as a class) associated with the setting key.
|
<T> Class<? extends T> |
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.
|
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.
|
Map<String,Settings> |
getGroups(String settingPrefix)
Returns group settings for the given setting prefix.
|
int |
hashCode() |
static ImmutableSettings.Builder |
settingsBuilder()
Returns a builder to be used in order to build settings.
|
public ClassLoader getClassLoader()
SettingsgetClassLoader in interface Settingspublic com.google.common.collect.ImmutableMap<String,String> getAsMap()
SettingsMap.public Settings getByPrefix(String prefix)
SettingsgetByPrefix in interface Settingspublic String get(String setting)
Settingspublic String get(String setting, String defaultValue)
Settingspublic Float getAsFloat(String setting, Float defaultValue)
SettingsgetAsFloat in interface Settingssetting - The setting keydefaultValue - The value to return if no value is associated with the settingpublic Double getAsDouble(String setting, Double defaultValue)
SettingsgetAsDouble in interface Settingssetting - The setting keydefaultValue - The value to return if no value is associated with the settingpublic Integer getAsInt(String setting, Integer defaultValue)
Settingspublic Long getAsLong(String setting, Long defaultValue)
Settingspublic Boolean getAsBoolean(String setting, Boolean defaultValue)
SettingsgetAsBoolean in interface Settingssetting - The setting keydefaultValue - The value to return if no value is associated with the settingpublic TimeValue getAsTime(String setting, TimeValue defaultValue)
Settingspublic ByteSizeValue getAsBytesSize(String setting, ByteSizeValue defaultValue) throws SettingsException
SettingsgetAsBytesSize in interface Settingssetting - The setting keydefaultValue - The value to return if no value is associated with the settingSettingsException - Failure to parse the settingpublic SizeValue getAsSize(String setting, SizeValue defaultValue) throws SettingsException
SettingsgetAsSize in interface Settingssetting - The setting keydefaultValue - The value to return if no value is associated with the settingSettingsException - Failure to parse the settingpublic <T> Class<? extends T> getAsClass(String setting, Class<? extends T> defaultClazz) throws NoClassSettingsException
SettingsgetAsClass in interface SettingsT - The type of the classsetting - The setting keydefaultClazz - The class to return if no value is associated with the settingNoClassSettingsException - Failure to load a classpublic <T> Class<? extends T> getAsClass(String setting, Class<? extends T> defaultClazz, String prefixPackage, String suffixClassName) throws NoClassSettingsException
SettingsgetAsClass in interface SettingsT - 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 isNoClassSettingsException - Failure to load the classpublic String[] getAsArray(String settingPrefix) throws SettingsException
SettingsIt will also automatically load a comma separated list under the settingPrefix and merge with the numbered format.
getAsArray in interface SettingssettingPrefix - The setting prefix to load the array bySettingsExceptionpublic String[] getAsArray(String settingPrefix, String[] defaultArray) throws SettingsException
SettingsIt will also automatically load a comma separated list under the settingPrefix and merge with the numbered format.
getAsArray in interface SettingssettingPrefix - The setting prefix to load the array bySettingsExceptionpublic Map<String,Settings> getGroups(String settingPrefix) throws SettingsException
SettingsgetGroups in interface SettingsSettingsExceptionpublic static ImmutableSettings.Builder settingsBuilder()
Copyright © 2019. All Rights Reserved.