Interface Configuration
- All Known Implementing Classes:
DefaultConfiguration
public interface Configuration
Application configuration.
-
Method Summary
Modifier and TypeMethodDescription<T> Optional<T>getPropertyValue(String propertyName, Class<T> type) Get the value of a configuration property.<T> TgetPropertyValue(String propertyName, Class<T> type, T defaultValue) Get the value of a configuration property.<T> TgetRequiredPropertyValue(String propertyName, Class<T> type) Get a required value of a configuration property.
-
Method Details
-
getPropertyValue
Get the value of a configuration property.- Type Parameters:
T- Type of the property value- Parameters:
propertyName- Name of the propertytype- Type of the property value- Returns:
- Value of the property or empty if the property is missing
-
getPropertyValue
Get the value of a configuration property.- Type Parameters:
T- Type of the property value- Parameters:
propertyName- Name of the propertytype- Type of the property valuedefaultValue- Default value if the property is missing- Returns:
- Value of the property or the default value if the property is missing
-
getRequiredPropertyValue
<T> T getRequiredPropertyValue(String propertyName, Class<T> type) throws MissingConfigurationPropertyException Get a required value of a configuration property.- Type Parameters:
T- Type of the property value- Parameters:
propertyName- Name of the propertytype- Type of the property value- Returns:
- Value of the property
- Throws:
MissingConfigurationPropertyException- If the property is missing
-