Class PropertyNamesMatcher

java.lang.Object
io.smallrye.config.PropertyNamesMatcher

public final class PropertyNamesMatcher extends Object
A matcher of configuration names.

Due to the equality rules of PropertyName, it is unsuitable to be used as is in hash-based searches. Instead, this matcher splits the names by prefixes, which act as buckets, and then does a linear search.

Also avoids having to merge the prefix and the name into a single PropertyName, if both representations are already separate for the matching.

  • Method Details

    • matches

      public boolean matches(String name)
      Match a name with any of the names contained in this matcher.
      Parameters:
      name - the String to be matched
      Returns:
      true if matched or false otherwise.
    • matches

      public boolean matches(String prefix, String name)
      Match a prefix and a name with any of the names contained in this matcher.
      Parameters:
      prefix - the String to be matched, only the prefix
      name - the String to be matched, only the name after the prefix
      Returns:
      true if matched or false otherwise.
    • matcher

      public static PropertyNamesMatcher matcher(Map<String,List<PropertyName>> prefixesAndNames)