Class VariableResolver

java.lang.Object
dev.orne.config.impl.VariableResolver
All Implemented Interfaces:
ValueDecorator

@API(status=INTERNAL, since="1.0") public class VariableResolver extends Object implements ValueDecorator
StringSubstitutor based configuration property values variable resolver.
Since:
1.0
Version:
1.0, 2025-04
Author:
(w) Iker Hernaez
See Also:
  • StringSubstitutor
  • Constructor Details

    • VariableResolver

      public VariableResolver(@NotNull @NotNull Config config)
      Creates a new instance base on the specified configuration.
      Parameters:
      config - The configuration instance.
    • VariableResolver

      public VariableResolver(@NotNull @NotNull org.apache.commons.text.StringSubstitutor substitutor)
      Creates a new instance using the specified string substitutor.
      Parameters:
      substitutor - The string substitutor to use.
  • Method Details

    • decorate

      public String decorate(String value)
      Decorates the configuration property value.
      Specified by:
      decorate in interface ValueDecorator
      Parameters:
      value - The configuration property value.
      Returns:
      The decorated configuration property value.
    • clearCache

      public void clearCache()
      Clears the resolved values cache.