Interface ConfigurationService
-
- All Known Implementing Classes:
ConfigurationServiceImpl
public interface ConfigurationService
Service holding runtime configuration properties.- Since:
- 7.4
-
-
Field Summary
Fields Modifier and Type Field Description static String
LIST_SEPARATOR
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Optional<Boolean>
getBoolean(String key)
Returns the given property value if any.Optional<Duration>
getDuration(String key)
Returns the given property value if any.Duration
getDuration(String key, Duration defaultValue)
Returns the given property value if any, otherwise returns the given default value.Optional<Integer>
getInteger(String key)
Returns the given property value if any.int
getInteger(String key, int defaultValue)
Returns the given property value if any, otherwise returns the given default value.Optional<Long>
getLong(String key)
Returns the given property value if any.long
getLong(String key, long defaultValue)
Returns the given property value if any, otherwise returns the given default value.Map<String,Serializable>
getProperties(String namespace)
Returns the properties with key starting with the given namespace.String
getPropertiesAsJson(String namespace)
Returns the json string representing the properties with key starting with the given namespace.String
getProperty(String key)
Deprecated.since 11.1, usegetString(String)
insteadString
getProperty(String key, String defaultValue)
Deprecated.since 11.1, usegetString(String, String)
insteadOptional<String>
getString(String key)
Returns the given property value if any.String
getString(String key, String defaultValue)
Returns the given property value if any, otherwise returns the given default value.boolean
isBooleanFalse(String key)
Returns true if given property exists and is false when compared to a boolean value.boolean
isBooleanPropertyFalse(String key)
Deprecated.since 11.1, useisBooleanFalse(String)
insteadboolean
isBooleanPropertyTrue(String key)
Deprecated.since 11.1, useisBooleanTrue(String)
insteadboolean
isBooleanTrue(String key)
Returns true if given property exists and is true when compared to a boolean value.
-
-
-
Field Detail
-
LIST_SEPARATOR
static final String LIST_SEPARATOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
getString
Optional<String> getString(String key)
Returns the given property value if any.- Parameters:
key
- the property key- Since:
- 11.1
-
getString
String getString(String key, String defaultValue)
Returns the given property value if any, otherwise returns the given default value.- Parameters:
key
- the property keydefaultValue
- the default value for this key- Since:
- 11.1
-
getInteger
Optional<Integer> getInteger(String key)
Returns the given property value if any.- Parameters:
key
- the property key- Since:
- 11.1
-
getInteger
int getInteger(String key, int defaultValue)
Returns the given property value if any, otherwise returns the given default value.- Parameters:
key
- the property keydefaultValue
- the default value for this key- Since:
- 11.1
-
getLong
Optional<Long> getLong(String key)
Returns the given property value if any.- Parameters:
key
- the property key- Since:
- 11.1
-
getLong
long getLong(String key, long defaultValue)
Returns the given property value if any, otherwise returns the given default value.- Parameters:
key
- the property keydefaultValue
- the default value for this key- Since:
- 11.1
-
getBoolean
Optional<Boolean> getBoolean(String key)
Returns the given property value if any.- Parameters:
key
- the property key- Since:
- 11.1
-
isBooleanTrue
boolean isBooleanTrue(String key)
Returns true if given property exists and is true when compared to a boolean value.prop=true | isBooleanTrue("prop") = true prop=trUe | isBooleanTrue("prop") = true prop=false | isBooleanTrue("prop") = false prop=any | isBooleanTrue("prop") = false prop= | isBooleanTrue("prop") = false
- Since:
- 11.1
-
isBooleanFalse
boolean isBooleanFalse(String key)
Returns true if given property exists and is false when compared to a boolean value.prop=false | isBooleanFalse("prop") = true prop=fAlse | isBooleanFalse("prop") = true prop=true | isBooleanFalse("prop") = false prop=any | isBooleanFalse("prop") = false prop= | isBooleanFalse("prop") = false
- Since:
- 11.1
-
getDuration
Optional<Duration> getDuration(String key)
Returns the given property value if any.- Parameters:
key
- the property key- Since:
- 11.1
-
getDuration
Duration getDuration(String key, Duration defaultValue)
Returns the given property value if any, otherwise returns the given default value.- Parameters:
key
- the property keydefaultValue
- the default value for this key- Since:
- 11.1
-
getProperty
@Deprecated String getProperty(String key)
Deprecated.since 11.1, usegetString(String)
insteadReturns the given property value if any, otherwise null.- Parameters:
key
- the property key
-
getProperty
@Deprecated String getProperty(String key, String defaultValue)
Deprecated.since 11.1, usegetString(String, String)
insteadReturns the given property value if any, otherwise returns the given default value.- Parameters:
key
- the property keydefaultValue
- the default value for this key
-
getProperties
Map<String,Serializable> getProperties(String namespace)
Returns the properties with key starting with the given namespace.- Parameters:
namespace
- the namespace- Returns:
- a map of properties with trimmed keys (namespace removed)
- Since:
- 10.3
-
isBooleanPropertyTrue
@Deprecated boolean isBooleanPropertyTrue(String key)
Deprecated.since 11.1, useisBooleanTrue(String)
insteadReturns true if given property is true when compared to a boolean value.
-
isBooleanPropertyFalse
@Deprecated boolean isBooleanPropertyFalse(String key)
Deprecated.since 11.1, useisBooleanFalse(String)
insteadReturns true if given property is false when compared to a boolean value.Returns also true if property is not blank and is not equals to true.
-
getPropertiesAsJson
String getPropertiesAsJson(String namespace) throws IOException
Returns the json string representing the properties with key starting with the given namespace.- Parameters:
namespace
- the namespace of the properties- Throws:
IOException
- Since:
- 10.3
-
-