Package com.sap.cds.services.environment
Interface PropertiesProvider
public interface PropertiesProvider
The interface exposing configuration properties.
-
Method Summary
Modifier and TypeMethodDescription<T> T
bindPropertyClass
(String section, Class<T> clazz) Binds the configuration POJO to the specified sectiondefault String
getProperty
(String key) Returns the value of the property value with given key asString
.default <T> T
getProperty
(String key, Class<T> asClazz) Returns the value of the property with given key as given typeasClazz
.<T> T
getProperty
(String key, Class<T> asClazz, T defaultValue) Returns the value of the property with given key as given typeasClazz
.getProperty
(String key, String defaultValue) Returns the value of the property with given key asString
.default boolean
hasProperty
(String key) Checks if the property with given key is defined.
-
Method Details
-
bindPropertyClass
Binds the configuration POJO to the specified section- Type Parameters:
T
- the type of the POJO- Parameters:
section
- the properties sectionclazz
- the class of the POJO- Returns:
- The properties instance
-
hasProperty
Checks if the property with given key is defined.- Parameters:
key
- The key of the property- Returns:
true
if the property with keykey
is defined
-
getProperty
Returns the value of the property value with given key asString
.- Parameters:
key
- The key of the property- Returns:
- The
String
value ornull
if not defined
-
getProperty
Returns the value of the property with given key asString
. Returns the specified default value if key is not existing.- Parameters:
key
- The key of the propertydefaultValue
- The default value if the key is not present- Returns:
- The
String
value ordefaultValue
if not defined
-
getProperty
Returns the value of the property with given key as given typeasClazz
.- Type Parameters:
T
- the type of the property value- Parameters:
key
- The key of the propertyasClazz
- The type of the property value- Returns:
- The value or null if not defined
-
getProperty
Returns the value of the property with given key as given typeasClazz
. Returns the specified default value if key is not existing.- Type Parameters:
T
- the type of the property value- Parameters:
key
- The key of the propertyasClazz
- The type of the property valuedefaultValue
- The default value if the key is not present- Returns:
- The property value or
defaultValue
if not defined
-