Package com.sap.cds.services.environment
Interface PropertiesProvider
public interface PropertiesProvider
The interface exposing configuration properties.
-
Method Summary
Modifier and TypeMethodDescription<T> TbindPropertyClass(String section, Class<T> clazz) Binds the configuration POJO to the specified sectiondefault StringgetProperty(String key) Returns the value of the property value with given key asString.default <T> TgetProperty(String key, Class<T> asClazz) Returns the value of the property with given key as given typeasClazz.<T> TgetProperty(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 booleanhasProperty(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:
trueif the property with keykeyis defined
-
getProperty
Returns the value of the property value with given key asString.- Parameters:
key- The key of the property- Returns:
- The
Stringvalue ornullif 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
Stringvalue ordefaultValueif 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
defaultValueif not defined
-