public final class Configuration
extends java.lang.Object
CONFIGURATION_FILE
system property.CONFIGURATION_FILE_REQUIRED
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIGURATION_FILE
Specifies the main configuration file.
Value type: String Default value: null |
static java.lang.String |
CONFIGURATION_FILE_REQUIRED
Specifies whether or not the application requires configuration file to run.
If this is set to true and the file referenced by CONFIGURATION_FILE is not found an exception is thrown. Value type: Boolean Default value: false |
Modifier and Type | Method and Description |
---|---|
static PropertyValue<java.lang.Boolean> |
booleanValue(java.lang.String key,
java.lang.Boolean defaultValue)
Creates a boolean configuration value
|
static PropertyValue<java.lang.Double> |
doubleValue(java.lang.String key,
java.lang.Double defaultValue)
Creates a double configuration value
|
static PropertyValue<java.lang.Integer> |
integerValue(java.lang.String key,
java.lang.Integer defaultValue)
Creates a integer configuration value
|
static PropertyValue<java.lang.Long> |
longValue(java.lang.String key,
java.lang.Long defaultValue)
Creates a long configuration value
|
static PropertyValue<java.lang.String> |
stringValue(java.lang.String key,
java.lang.String defaultValue)
Creates a string configuration value
|
static <T> PropertyValue<T> |
value(java.lang.String key,
T defaultValue,
java.util.function.Function<java.lang.String,T> parser)
Creates a configuration value
|
public static final java.lang.String CONFIGURATION_FILE
public static final java.lang.String CONFIGURATION_FILE_REQUIRED
CONFIGURATION_FILE
public static PropertyValue<java.lang.Boolean> booleanValue(java.lang.String key, java.lang.Boolean defaultValue)
key
- the configuration keydefaultValue
- the default value, if anypublic static PropertyValue<java.lang.Integer> integerValue(java.lang.String key, java.lang.Integer defaultValue)
key
- the configuration keydefaultValue
- the default value, if anypublic static PropertyValue<java.lang.Long> longValue(java.lang.String key, java.lang.Long defaultValue)
key
- the configuration keydefaultValue
- the default value, if anypublic static PropertyValue<java.lang.Double> doubleValue(java.lang.String key, java.lang.Double defaultValue)
key
- the configuration keydefaultValue
- the default value, if anypublic static PropertyValue<java.lang.String> stringValue(java.lang.String key, java.lang.String defaultValue)
key
- the configuration keydefaultValue
- the default value, if anypublic static <T> PropertyValue<T> value(java.lang.String key, T defaultValue, java.util.function.Function<java.lang.String,T> parser)
T
- the value typekey
- the configuration keydefaultValue
- the default valueparser
- the parser used to parse a string representation of the value