public abstract class AbstractConfiguration extends java.lang.Object implements Configuration
| Constructor and Description |
|---|
AbstractConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Properties |
asProperties() |
protected <T> T |
convertValue(java.lang.Object value,
java.lang.Class<T> type) |
protected <T> T |
convertValue(java.lang.Object value,
java.lang.Class<T> type,
java.lang.String format) |
<T> T |
get(java.lang.String key,
T defaultValue)
Returns the value associated with the given key.
|
<T> T |
getAs(java.lang.String key)
/**
Finds a value associated with the given key.
|
<T> T |
getAs(java.lang.String key,
T defaultValue)
Finds a value associated with the given key.
|
boolean |
getAsBoolean(java.lang.String key)
Finds a value associated with the given key.
|
boolean |
getAsBoolean(java.lang.String key,
boolean defaultValue)
Finds a value associated with the given key.
|
double |
getAsDouble(java.lang.String key)
Finds a value associated with the given key.
|
double |
getAsDouble(java.lang.String key,
double defaultValue)
Finds a value associated with the given key.
|
float |
getAsFloat(java.lang.String key)
Finds a value associated with the given key.
|
float |
getAsFloat(java.lang.String key,
float defaultValue)
Finds a value associated with the given key.
|
int |
getAsInt(java.lang.String key)
Finds a value associated with the given key.
|
int |
getAsInt(java.lang.String key,
int defaultValue)
Finds a value associated with the given key.
|
long |
getAsLong(java.lang.String key)
Finds a value associated with the given key.
|
long |
getAsLong(java.lang.String key,
long defaultValue)
Finds a value associated with the given key.
|
java.lang.String |
getAsString(java.lang.String key)
Finds a value associated with the given key.
|
java.lang.String |
getAsString(java.lang.String key,
java.lang.String defaultValue)
Finds a value associated with the given key.
|
java.lang.Object |
getAt(java.lang.String key)
Returns the value associated with the given key.
|
<T> T |
getAt(java.lang.String key,
T defaultValue)
Returns the value associated with the given key.
|
<T> T |
getConverted(java.lang.String key,
java.lang.Class<T> type)
Finds a value associated with the given key.
|
<T> T |
getConverted(java.lang.String key,
java.lang.Class<T> type,
java.lang.String format)
Finds a value associated with the given key.
|
<T> T |
getConverted(java.lang.String key,
java.lang.Class<T> type,
java.lang.String format,
T defaultValue)
Finds a value associated with the given key.
|
<T> T |
getConverted(java.lang.String key,
java.lang.Class<T> type,
T defaultValue)
Finds a value associated with the given key.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasFlatMap, asResourceBundle, containsKey, get@Nullable
public <T> T get(@Nonnull
java.lang.String key,
@Nullable
T defaultValue)
Configurationget in interface ConfigurationT - the type of the valuekey - the key to searchdefaultValue - the value to be returned if the key was not found@Nullable
public java.lang.Object getAt(@Nonnull
java.lang.String key)
ConfigurationgetAt in interface Configurationkey - the key to search@Nullable
public <T> T getAt(@Nonnull
java.lang.String key,
@Nullable
T defaultValue)
ConfigurationgetAt in interface ConfigurationT - the type of the valuekey - the key to searchdefaultValue - the value to be returned if the key was not foundpublic boolean getAsBoolean(@Nonnull
java.lang.String key)
ConfigurationgetAsBoolean in interface Configurationkey - the key to searchpublic boolean getAsBoolean(@Nonnull
java.lang.String key,
boolean defaultValue)
ConfigurationgetAsBoolean in interface Configurationkey - the key to searchdefaultValue - the value to be returned if the key is not foundpublic int getAsInt(@Nonnull
java.lang.String key)
ConfigurationgetAsInt in interface Configurationkey - the key to searchpublic int getAsInt(@Nonnull
java.lang.String key,
int defaultValue)
ConfigurationgetAsInt in interface Configurationkey - the key to searchdefaultValue - the value to be returned if the key is not foundpublic long getAsLong(@Nonnull
java.lang.String key)
ConfigurationgetAsLong in interface Configurationkey - the key to searchpublic long getAsLong(@Nonnull
java.lang.String key,
long defaultValue)
ConfigurationgetAsLong in interface Configurationkey - the key to searchdefaultValue - the value to be returned if the key is not foundpublic float getAsFloat(@Nonnull
java.lang.String key)
ConfigurationgetAsFloat in interface Configurationkey - the key to searchpublic float getAsFloat(@Nonnull
java.lang.String key,
float defaultValue)
ConfigurationgetAsFloat in interface Configurationkey - the key to searchdefaultValue - the value to be returned if the key is not foundpublic double getAsDouble(@Nonnull
java.lang.String key)
ConfigurationgetAsDouble in interface Configurationkey - the key to searchpublic double getAsDouble(@Nonnull
java.lang.String key,
double defaultValue)
ConfigurationgetAsDouble in interface Configurationkey - the key to searchdefaultValue - the value to be returned if the key is not found@Nullable
public java.lang.String getAsString(@Nonnull
java.lang.String key)
ConfigurationgetAsString in interface Configurationkey - the key to search@Nullable
public <T> T getAs(@Nonnull
java.lang.String key)
ConfigurationgetAs in interface Configurationkey - the key to search@Nullable
public <T> T getAs(@Nonnull
java.lang.String key,
@Nullable
T defaultValue)
ConfigurationgetAs in interface Configurationkey - the key to searchdefaultValue - the value to be returned if the key is not found@Nullable
public <T> T getConverted(@Nonnull
java.lang.String key,
@Nonnull
java.lang.Class<T> type)
ConfigurationPropertyEditor.getConverted in interface Configurationkey - the key to searchtype - the type to be returned@Nullable
public <T> T getConverted(@Nonnull
java.lang.String key,
@Nonnull
java.lang.Class<T> type,
@Nullable
T defaultValue)
ConfigurationPropertyEditor.
If not found then the supplied defaultValue will be returned.getConverted in interface Configurationkey - the key to searchtype - the type to be returneddefaultValue - the value to be returned if the key is not found@Nullable
public <T> T getConverted(@Nonnull
java.lang.String key,
@Nonnull
java.lang.Class<T> type,
@Nonnull
java.lang.String format)
ConfigurationPropertyEditor.getConverted in interface Configurationkey - the key to searchtype - the type to be returnedformat - format used to convert the value@Nullable
public <T> T getConverted(@Nonnull
java.lang.String key,
@Nonnull
java.lang.Class<T> type,
@Nonnull
java.lang.String format,
@Nullable
T defaultValue)
ConfigurationPropertyEditor.
If not found then the supplied defaultValue will be returned.getConverted in interface Configurationkey - the key to searchtype - the type to be returnedformat - format used to convert the valuedefaultValue - the value to be returned if the key is not foundprotected <T> T convertValue(@Nullable
java.lang.Object value,
@Nonnull
java.lang.Class<T> type)
protected <T> T convertValue(@Nullable
java.lang.Object value,
@Nonnull
java.lang.Class<T> type,
@Nonnull
java.lang.String format)
@Nullable
public java.lang.String getAsString(@Nonnull
java.lang.String key,
@Nullable
java.lang.String defaultValue)
ConfigurationgetAsString in interface Configurationkey - the key to searchdefaultValue - the value to be returned if the key is not found@Nonnull public java.util.Properties asProperties()
asProperties in interface Configuration