Class OverrideConfigFilter

  • All Implemented Interfaces:
    ConfigFilter

    public class OverrideConfigFilter
    extends Object
    implements ConfigFilter
    A config filter that replaces values with a new ones of keys that matching with Pattern.
    • Constructor Detail

      • OverrideConfigFilter

        public OverrideConfigFilter​(Supplier<List<Map.Entry<Predicate<Config.Key>,​String>>> overrideValuesSupplier)
        Creates a filter with a given supplier of a map of key patterns to a override values.
        Parameters:
        overrideValuesSupplier - a supplier of a map of key patterns to a override values
    • Method Detail

      • apply

        public String apply​(Config.Key key,
                            String stringValue)
        Description copied from interface: ConfigFilter
        Filters an elementary config value before it is made available to the application via the Config API.
        Specified by:
        apply in interface ConfigFilter
        Parameters:
        key - configuration key associated with the Config node
        stringValue - original value to be filtered, never null
        Returns:
        original value or filtered (changed) value, never null