public interface Configuration
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
asFlatMap() |
java.util.Properties |
asProperties() |
java.util.ResourceBundle |
asResourceBundle() |
boolean |
containsKey(java.lang.String key)
Searches for the key in this configuration.
|
java.lang.Object |
get(java.lang.String key)
Returns the value associated with the given key.
|
<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.
|
boolean containsKey(@Nonnull java.lang.String key)
key
- the key to search@Nonnull java.util.Map<java.lang.String,java.lang.Object> asFlatMap()
@Nonnull java.util.ResourceBundle asResourceBundle()
@Nonnull java.util.Properties asProperties()
@Nullable java.lang.Object get(@Nonnull java.lang.String key)
key
- the key to search@Nullable <T> T get(@Nonnull java.lang.String key, @Nullable T defaultValue)
T
- the type of the valuekey
- the key to searchdefaultValue
- the value to be returned if the key was not found@Nullable java.lang.Object getAt(@Nonnull java.lang.String key)
key
- the key to search@Nullable <T> T getAt(@Nonnull java.lang.String key, @Nullable T defaultValue)
T
- the type of the valuekey
- the key to searchdefaultValue
- the value to be returned if the key was not foundboolean getAsBoolean(@Nonnull java.lang.String key)
key
- the key to searchboolean getAsBoolean(@Nonnull java.lang.String key, boolean defaultValue)
key
- the key to searchdefaultValue
- the value to be returned if the key is not foundint getAsInt(@Nonnull java.lang.String key)
key
- the key to searchint getAsInt(@Nonnull java.lang.String key, int defaultValue)
key
- the key to searchdefaultValue
- the value to be returned if the key is not foundlong getAsLong(@Nonnull java.lang.String key)
key
- the key to searchlong getAsLong(@Nonnull java.lang.String key, long defaultValue)
key
- the key to searchdefaultValue
- the value to be returned if the key is not foundfloat getAsFloat(@Nonnull java.lang.String key)
key
- the key to searchfloat getAsFloat(@Nonnull java.lang.String key, float defaultValue)
key
- the key to searchdefaultValue
- the value to be returned if the key is not founddouble getAsDouble(@Nonnull java.lang.String key)
key
- the key to searchdouble getAsDouble(@Nonnull java.lang.String key, double defaultValue)
key
- the key to searchdefaultValue
- the value to be returned if the key is not found@Nullable java.lang.String getAsString(@Nonnull java.lang.String key)
key
- the key to search@Nullable java.lang.String getAsString(@Nonnull java.lang.String key, @Nullable java.lang.String defaultValue)
key
- the key to searchdefaultValue
- the value to be returned if the key is not found@Nullable <T> T getAs(@Nonnull java.lang.String key)
key
- the key to search@Nullable <T> T getAs(@Nonnull java.lang.String key, @Nullable T defaultValue)
key
- the key to searchdefaultValue
- the value to be returned if the key is not found@Nullable <T> T getConverted(@Nonnull java.lang.String key, @Nonnull java.lang.Class<T> type)
PropertyEditor
.key
- the key to searchtype
- the type to be returned@Nullable <T> T getConverted(@Nonnull java.lang.String key, @Nonnull java.lang.Class<T> type, @Nonnull java.lang.String format)
PropertyEditor
.key
- the key to searchtype
- the type to be returnedformat
- format used to convert the value@Nullable <T> T getConverted(@Nonnull java.lang.String key, @Nonnull java.lang.Class<T> type, @Nullable T defaultValue)
PropertyEditor
.
If not found then the supplied defaultValue will be returned.key
- the key to searchtype
- the type to be returneddefaultValue
- the value to be returned if the key is not found@Nullable <T> T getConverted(@Nonnull java.lang.String key, @Nonnull java.lang.Class<T> type, @Nonnull java.lang.String format, @Nullable T defaultValue)
PropertyEditor
.
If not found then the supplied defaultValue will be returned.key
- 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 found