Interface ConfigPatternMatcher

All Known Implementing Classes:
MatchingPointConfigPatternMatcher, RegexConfigPatternMatcher, WildcardConfigPatternMatcher
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public interface ConfigPatternMatcher
The ConfigPatternMatcher provides a strategy to match an item name to a configuration pattern.

It is used on each Config.getXXXConfig() and ClientConfig.getXXXConfig() call for any data structure. It is supplied a list of config patterns and the name of the item that the configuration is requested for.

Default matcher is MatchingPointConfigPatternMatcher.

  • Method Summary

    Modifier and Type Method Description
    String matches​(Iterable<String> configPatterns, String itemName)
    Returns the best match for an item name out of a list of configuration patterns.
  • Method Details

    • matches

      String matches​(Iterable<String> configPatterns, String itemName) throws InvalidConfigurationException
      Returns the best match for an item name out of a list of configuration patterns.
      Parameters:
      configPatterns - list of known configuration patterns
      itemName - item name to match
      Returns:
      a key of configPatterns which matches the item name or null if there is no match
      Throws:
      InvalidConfigurationException - if ambiguous configurations are found