Package io.micronaut.core.value
Interface ValueResolver<K extends java.lang.CharSequence>
-
- Type Parameters:
K
- parent type
- All Known Subinterfaces:
AnnotationValueResolver
,ConvertibleMultiValues<V>
,ConvertibleValues<V>
,Headers
,MutableConvertibleMultiValues<V>
,MutableConvertibleValues<V>
,MutableHeaders
,PropertyResolver
- All Known Implementing Classes:
AnnotationValue
,ConvertibleMultiValuesMap
,ConvertibleValuesMap
,MapPropertyResolver
,MutableConvertibleMultiValuesMap
,MutableConvertibleValuesMap
public interface ValueResolver<K extends java.lang.CharSequence>
An interface for any type that is able to resolve and convert values.- Since:
- 1.0
- See Also:
TypeConverter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> java.util.Optional<T>
get(K name, ArgumentConversionContext<T> conversionContext)
Resolve the given property for the given name.default <T> java.util.Optional<T>
get(K name, Argument<T> requiredType)
Resolve the given property for the given name.default <T> java.util.Optional<T>
get(K name, java.lang.Class<T> requiredType)
Resolve the given property for the given name.default <T> T
get(K name, java.lang.Class<T> requiredType, T defaultValue)
Resolve the given property for the given name.
-
-
-
Method Detail
-
get
<T> java.util.Optional<T> get(K name, ArgumentConversionContext<T> conversionContext)
Resolve the given property for the given name.- Type Parameters:
T
- The concrete type- Parameters:
name
- The nameconversionContext
- The conversion context- Returns:
- An optional containing the property value if it exists and is able to be converted
-
get
default <T> java.util.Optional<T> get(K name, java.lang.Class<T> requiredType)
Resolve the given property for the given name.- Type Parameters:
T
- The concrete type- Parameters:
name
- The namerequiredType
- The required type- Returns:
- An optional containing the property value if it exists and is able to be converted
-
get
default <T> java.util.Optional<T> get(K name, Argument<T> requiredType)
Resolve the given property for the given name.- Type Parameters:
T
- The concrete type- Parameters:
name
- The namerequiredType
- The required type- Returns:
- An optional containing the property value if it exists and is able to be converted
-
get
default <T> T get(K name, java.lang.Class<T> requiredType, T defaultValue)
Resolve the given property for the given name.- Type Parameters:
T
- The concrete type- Parameters:
name
- The namerequiredType
- The required typedefaultValue
- The default value- Returns:
- Property value if it exists or default value
-
-