public interface PropertyResolver
Allows retrieving properties as raw String values or converted to a specific type.
| Modifier and Type | Method and Description |
|---|---|
java.util.Optional<java.lang.String> |
getProperty(java.lang.String key)
Retrieves the property value associated with the given key as a
String. |
<T> java.util.Optional<T> |
getPropertyAs(java.lang.String key,
java.lang.Class<T> type)
Retrieves the property value associated with the given key and converts it to the specified type.
|
default java.lang.String |
getRequiredProperty(java.lang.String key) |
default <T> T |
getRequiredPropertyAs(java.lang.String key,
java.lang.Class<T> type) |
java.util.Optional<java.lang.String> getProperty(java.lang.String key)
String.key - the property keyOptional containing the string value if present, otherwise emptydefault java.lang.String getRequiredProperty(java.lang.String key)
<T> java.util.Optional<T> getPropertyAs(java.lang.String key,
java.lang.Class<T> type)
T - the expected type of the returned valuekey - the property keytype - the target type to convert the value toOptional containing the converted value if present and successfully converted, otherwise emptydefault <T> T getRequiredPropertyAs(java.lang.String key,
java.lang.Class<T> type)