Interface PropertyResolverDelegate

All Superinterfaces:
PropertyResolver, ValueResolver<String>

@Internal public interface PropertyResolverDelegate extends PropertyResolver, ValueResolver<String>
The PropertyResolverDelegate interface acts as a wrapper or intermediary for a 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 Details

    • delegate

      PropertyResolver delegate()
      Returns the delegated PropertyResolver instance.
      Returns:
      the delegate PropertyResolver
    • containsProperty

      default boolean containsProperty(@NonNull String name)
      Description copied from interface: PropertyResolver

      Whether 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.bar this method will return false for: resolver.containsProperty("foo")

      To check for nested properties using PropertyResolver.containsProperties(String) instead.

      Specified by:
      containsProperty in interface PropertyResolver
      Parameters:
      name - The name of the property
      Returns:
      True if it is
    • containsProperties

      default boolean containsProperties(@NonNull String name)
      Description copied from interface: PropertyResolver
      Whether the given property or any nested properties exist for the key given key within this resolver.
      Specified by:
      containsProperties in interface PropertyResolver
      Parameters:
      name - The name of the property
      Returns:
      True if it is
    • getProperty

      default <T> @NonNull Optional<T> getProperty(@NonNull String name, @NonNull ArgumentConversionContext<T> conversionContext)
      Description copied from interface: PropertyResolver

      Resolve 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:
      getProperty in interface PropertyResolver
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name
      conversionContext - The conversion context
      Returns:
      An optional containing the property value if it exists
    • getPropertyEntries

      default @NonNull Collection<String> getPropertyEntries(@NonNull String name)
      Description copied from interface: PropertyResolver
      Returns a collection of properties entries under the given key. For example given the following keys:
      
       datasource.default.url=localhost
       datasource.another.url=someother
       
      Calling getPropertyEntries(String) with a value of datasource will result in a collection containing default and other.
      Specified by:
      getPropertyEntries in interface PropertyResolver
      Parameters:
      name - The name to resolve
      Returns:
      The property entries.
    • getPropertyEntries

      default @NonNull Collection<String> getPropertyEntries(@NonNull String name, @NonNull PropertyCatalog propertyCatalog)
      Description copied from interface: PropertyResolver
      Returns a collection of properties entries under the given key, but . For example, if you set PropertyCatalog.RAW then the following keys:
       datasource.MyDs-1.url=localhost
       datasource.MyDs-2.url=someother
       
      Calling getPropertyEntries(String) with a value of datasource will result in a collection containing MyDs-1 and MyDs-2 (without normalization).
      Specified by:
      getPropertyEntries in interface PropertyResolver
      Parameters:
      name - The name to resolve
      propertyCatalog - property catalog to use
      Returns:
      The property entries.
    • getProperty

      default <T> @NonNull Optional<T> getProperty(@NonNull String name, @NonNull Argument<T> argument)
      Description copied from interface: PropertyResolver

      Resolve 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:
      getProperty in interface PropertyResolver
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name
      argument - The required type
      Returns:
      An optional containing the property value if it exists
    • getProperties

      default @NonNull Map<String,Object> getProperties(@NonNull String name)
      Description copied from interface: PropertyResolver
      Return all the properties under the given key.
      Specified by:
      getProperties in interface PropertyResolver
      Parameters:
      name - The name
      Returns:
      The properties
    • getProperties

      default @NonNull Map<String,Object> getProperties(@Nullable String name, @Nullable StringConvention keyFormat)
      Description copied from interface: PropertyResolver
      Return 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 in StringConvention.RAW.
      Specified by:
      getProperties in interface PropertyResolver
      Parameters:
      name - The name
      keyFormat - The key format to use for the keys. Default is kebab-case.
      Returns:
      The properties
    • getProperty

      default <T> @NonNull Optional<T> getProperty(@NonNull String name, @NonNull Class<T> requiredType, @NonNull ConversionContext context)
      Description copied from interface: PropertyResolver

      Resolve 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:
      getProperty in interface PropertyResolver
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name
      requiredType - The required type
      context - The ConversionContext to apply to any conversion
      Returns:
      An optional containing the property value if it exists
    • get

      default <T> @NonNull Optional<T> get(@NonNull String name, @NonNull ArgumentConversionContext<T> conversionContext)
      Description copied from interface: ValueResolver
      Resolve the given property for the given name.
      Specified by:
      get in interface PropertyResolver
      Specified by:
      get in interface ValueResolver<String>
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name
      conversionContext - The conversion context
      Returns:
      An optional containing the property value if it exists and is able to be converted
    • getProperty

      default <T> @NonNull Optional<T> getProperty(@NonNull String name, @NonNull Class<T> requiredType)
      Description copied from interface: PropertyResolver
      Resolve the given property for the given name.
      Specified by:
      getProperty in interface PropertyResolver
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name
      requiredType - The required type
      Returns:
      An optional containing the property value if it exists
    • getProperty

      default <T> @Nullable T getProperty(@NonNull String name, @NonNull Class<T> requiredType, @Nullable T defaultValue)
      Description copied from interface: PropertyResolver
      Resolve the given property for the given name.
      Specified by:
      getProperty in interface PropertyResolver
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name
      requiredType - The required type
      defaultValue - The default value
      Returns:
      An optional containing the property value if it exists
    • getRequiredProperty

      default <T> @NonNull T getRequiredProperty(@NonNull String name, @NonNull Class<T> requiredType)
      Description copied from interface: PropertyResolver
      Resolve the given property for the given name.
      Specified by:
      getRequiredProperty in interface PropertyResolver
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name of the property
      requiredType - The required type
      Returns:
      The value of the property
    • getPropertyPathMatches

      default @NonNull Collection<List<String>> getPropertyPathMatches(@NonNull String pathPattern)
      Description copied from interface: PropertyResolver
      Will return for a given pattern such as foo.*.bar.* and array of arrays containing the variable names that match the pattern.
      Specified by:
      getPropertyPathMatches in interface PropertyResolver
      Parameters:
      pathPattern - The path pattern
      Returns:
      An array of arrays.
    • get

      default <T> @NonNull Optional<T> get(@NonNull String name, @NonNull Class<T> requiredType)
      Description copied from interface: ValueResolver
      Resolve the given property for the given name.
      Specified by:
      get in interface ValueResolver<String>
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name
      requiredType - The required type
      Returns:
      An optional containing the property value if it exists and is able to be converted
    • get

      default <T> @NonNull Optional<T> get(@NonNull String name, @NonNull Argument<T> requiredType)
      Description copied from interface: ValueResolver
      Resolve the given property for the given name.
      Specified by:
      get in interface ValueResolver<String>
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name
      requiredType - The required type
      Returns:
      An optional containing the property value if it exists and is able to be converted
    • get

      default <T> T get(@NonNull String name, @NonNull Class<T> requiredType, T defaultValue)
      Description copied from interface: ValueResolver
      Resolve the given property for the given name.
      Specified by:
      get in interface ValueResolver<String>
      Type Parameters:
      T - The concrete type
      Parameters:
      name - The name
      requiredType - The required type
      defaultValue - The default value
      Returns:
      Property value if it exists or default value