Interface PropertyResolverDelegate
- All Superinterfaces:
PropertyResolver,ValueResolver<String>
PropertyResolver,
delegating all method calls to the underlying implementation. It combines functionality from the
PropertyResolver and ValueResolver interfaces.- Since:
- 5.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleancontainsProperties(String name) Whether the given property or any nested properties exist for the key given key within this resolver.default booleancontainsProperty(String name) Whether the given property is contained within this resolver.delegate()Returns the delegatedPropertyResolverinstance.default <T> Optional<T> get(String name, ArgumentConversionContext<T> conversionContext) Resolve the given property for the given name.default <T> Optional<T> Resolve the given property for the given name.default <T> Optional<T> Resolve the given property for the given name.default <T> TResolve the given property for the given name.getProperties(@Nullable String name, @Nullable StringConvention keyFormat) Return all the properties under the given key.getProperties(String name) Return all the properties under the given key.default <T> Optional<T> getProperty(String name, ArgumentConversionContext<T> conversionContext) Resolve the given property for the given name, type and generic type arguments.default <T> Optional<T> getProperty(String name, Argument<T> argument) Resolve the given property for the given name, type and generic type arguments.default <T> Optional<T> getProperty(String name, Class<T> requiredType) Resolve the given property for the given name.default <T> @Nullable TgetProperty(String name, Class<T> requiredType, @Nullable T defaultValue) Resolve the given property for the given name.default <T> Optional<T> getProperty(String name, Class<T> requiredType, ConversionContext context) Resolve the given property for the given name, type and generic type arguments.default Collection<String> getPropertyEntries(String name) Returns a collection of properties entries under the given key.default Collection<String> getPropertyEntries(String name, PropertyCatalog propertyCatalog) Returns a collection of properties entries under the given key, but .default Collection<List<String>> getPropertyPathMatches(String pathPattern) Will return for a given pattern such asfoo.*.bar.*and array of arrays containing the variable names that match the pattern.default <T> TgetRequiredProperty(String name, Class<T> requiredType) Resolve the given property for the given name.
-
Method Details
-
delegate
PropertyResolver delegate()Returns the delegatedPropertyResolverinstance.- Returns:
- the delegate
PropertyResolver
-
containsProperty
Description copied from interface:PropertyResolverWhether the given property is contained within this resolver.
Note that this method will return false for nested properties. In other words given a key of
foo.barthis method will returnfalsefor:resolver.containsProperty("foo")To check for nested properties using
PropertyResolver.containsProperties(String)instead.- Specified by:
containsPropertyin interfacePropertyResolver- Parameters:
name- The name of the property- Returns:
- True if it is
-
containsProperties
Description copied from interface:PropertyResolverWhether the given property or any nested properties exist for the key given key within this resolver.- Specified by:
containsPropertiesin interfacePropertyResolver- Parameters:
name- The name of the property- Returns:
- True if it is
-
getProperty
Description copied from interface:PropertyResolverResolve the given property for the given name, type and generic type arguments.
Implementers can choose to implement more intelligent type conversion by analyzing the typeArgument.
- Specified by:
getPropertyin interfacePropertyResolver- Type Parameters:
T- The concrete type- Parameters:
name- The nameconversionContext- The conversion context- Returns:
- An optional containing the property value if it exists
-
getPropertyEntries
Description copied from interface:PropertyResolverReturns a collection of properties entries under the given key. For example given the following keys:
Callingdatasource.default.url=localhost datasource.another.url=someothergetPropertyEntries(String)with a value ofdatasourcewill result in a collection containingdefaultandother.- Specified by:
getPropertyEntriesin interfacePropertyResolver- Parameters:
name- The name to resolve- Returns:
- The property entries.
-
getPropertyEntries
Description copied from interface:PropertyResolverReturns a collection of properties entries under the given key, but . For example, if you setPropertyCatalog.RAWthen the following keys:
Callingdatasource.MyDs-1.url=localhost datasource.MyDs-2.url=someothergetPropertyEntries(String)with a value ofdatasourcewill result in a collection containingMyDs-1andMyDs-2(without normalization).- Specified by:
getPropertyEntriesin interfacePropertyResolver- Parameters:
name- The name to resolvepropertyCatalog- property catalog to use- Returns:
- The property entries.
-
getProperty
Description copied from interface:PropertyResolverResolve the given property for the given name, type and generic type arguments.
Implementers can choose to implement more intelligent type conversion by analyzing the typeArgument.
- Specified by:
getPropertyin interfacePropertyResolver- Type Parameters:
T- The concrete type- Parameters:
name- The nameargument- The required type- Returns:
- An optional containing the property value if it exists
-
getProperties
Description copied from interface:PropertyResolverReturn all the properties under the given key.- Specified by:
getPropertiesin interfacePropertyResolver- Parameters:
name- The name- Returns:
- The properties
-
getProperties
default Map<String,Object> getProperties(@Nullable String name, @Nullable StringConvention keyFormat) Description copied from interface:PropertyResolverReturn all the properties under the given key. By default, Micronaut stores keys in keb-case, such that normalized lookups are more efficient. You can obtain the raw key values by passing inStringConvention.RAW.- Specified by:
getPropertiesin interfacePropertyResolver- Parameters:
name- The namekeyFormat- The key format to use for the keys. Default is kebab-case.- Returns:
- The properties
-
getProperty
Description copied from interface:PropertyResolverResolve the given property for the given name, type and generic type arguments.
Implementers can choose to implement more intelligent type conversion by analyzing the typeArgument.
- Specified by:
getPropertyin interfacePropertyResolver- Type Parameters:
T- The concrete type- Parameters:
name- The namerequiredType- The required typecontext- TheConversionContextto apply to any conversion- Returns:
- An optional containing the property value if it exists
-
get
Description copied from interface:ValueResolverResolve the given property for the given name.- Specified by:
getin interfacePropertyResolver- Specified by:
getin interfaceValueResolver<String>- 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
-
getProperty
Description copied from interface:PropertyResolverResolve the given property for the given name.- Specified by:
getPropertyin interfacePropertyResolver- Type Parameters:
T- The concrete type- Parameters:
name- The namerequiredType- The required type- Returns:
- An optional containing the property value if it exists
-
getProperty
Description copied from interface:PropertyResolverResolve the given property for the given name.- Specified by:
getPropertyin interfacePropertyResolver- Type Parameters:
T- The concrete type- Parameters:
name- The namerequiredType- The required typedefaultValue- The default value- Returns:
- An optional containing the property value if it exists
-
getRequiredProperty
Description copied from interface:PropertyResolverResolve the given property for the given name.- Specified by:
getRequiredPropertyin interfacePropertyResolver- Type Parameters:
T- The concrete type- Parameters:
name- The name of the propertyrequiredType- The required type- Returns:
- The value of the property
-
getPropertyPathMatches
Description copied from interface:PropertyResolverWill return for a given pattern such asfoo.*.bar.*and array of arrays containing the variable names that match the pattern.- Specified by:
getPropertyPathMatchesin interfacePropertyResolver- Parameters:
pathPattern- The path pattern- Returns:
- An array of arrays.
-
get
Description copied from interface:ValueResolverResolve the given property for the given name.- Specified by:
getin interfaceValueResolver<String>- 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
Description copied from interface:ValueResolverResolve the given property for the given name.- Specified by:
getin interfaceValueResolver<String>- 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
Description copied from interface:ValueResolverResolve the given property for the given name.- Specified by:
getin interfaceValueResolver<String>- 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
-