public class ConfigurationValueImpl extends Object implements ConfigurationValue
| Modifier | Constructor and Description |
|---|---|
protected |
ConfigurationValueImpl(String value) |
| Modifier and Type | Method and Description |
|---|---|
Optional<Boolean> |
asBoolean()
Retrieves the property value as a boolean.
|
boolean |
asBooleanOrDefault(boolean defaultValue)
Retrieves the property value as a boolean or the provided default value
if not present or if the value could not be parsed,
|
Optional<Integer> |
asInt()
Retrieves the property value as an integer.
|
int |
asIntOrDefault(int defaultValue)
Retrieves the property value as an integer or the provided default value
if not present or if the value could not be parsed,
|
Optional<Long> |
asLong()
Retrieves the property value as a long.
|
long |
asLongOrDefault(long defaultValue)
Retrieves the property value as a long or the provided default value if
not present or if the value could not be parsed,
|
Optional<String> |
asString()
Retrieves the property value as a string.
|
String |
asStringOrDefault(String defaultValue)
Retrieves the property value as string or the provided default value if
not present.
|
protected ConfigurationValueImpl(String value)
public Optional<String> asString()
ConfigurationValueasString in interface ConfigurationValuepublic Optional<Integer> asInt()
ConfigurationValueasInt in interface ConfigurationValuepublic Optional<Long> asLong()
ConfigurationValueasLong in interface ConfigurationValuepublic Optional<Boolean> asBoolean()
ConfigurationValueasBoolean in interface ConfigurationValuepublic String asStringOrDefault(String defaultValue)
ConfigurationValueasStringOrDefault in interface ConfigurationValuedefaultValue - the default value to be returned if the value is not presentpublic int asIntOrDefault(int defaultValue)
ConfigurationValueasIntOrDefault in interface ConfigurationValuedefaultValue - the default value to be returned if the value is not present
or could not be parsedpublic long asLongOrDefault(long defaultValue)
ConfigurationValueasLongOrDefault in interface ConfigurationValuedefaultValue - the default value to be returned if the value is not present
or could not be parsedpublic boolean asBooleanOrDefault(boolean defaultValue)
ConfigurationValueasBooleanOrDefault in interface ConfigurationValuedefaultValue - the default value to be returned if the value is not present
or could not be parsedCopyright © 2014. All rights reserved.