Class ConfigPatternMap<T>

java.lang.Object
io.quarkus.deployment.configuration.matching.ConfigPatternMap<T>
All Implemented Interfaces:
Iterable<T>

public final class ConfigPatternMap<T> extends Object implements Iterable<T>
A pattern-matching mapping of configuration key pattern to value.
  • Field Details

  • Constructor Details

    • ConfigPatternMap

      public ConfigPatternMap()
  • Method Details

    • match

      public T match(String name)
      Find the item which matches the given configuration key.
      Parameters:
      name - the configuration key (must not be null)
      Returns:
      the matching item
    • match

      public T match(NameIterator nameIterator)
      Find the item which matches the given configuration key iterator.
      Parameters:
      nameIterator - the configuration key iterator (must not be null)
      Returns:
      the matching item
    • matchLeaf

      T matchLeaf(NameIterator nameIterator)
    • addPattern

      public boolean addPattern(String pattern, T onMatch)
      Add a pattern to the map. The segments of the pattern are dot-separated. The special segment name {*} will match any single segment name. The special segment name {**} will eagerly match any segment name sequence.
      Parameters:
      pattern - the pattern (must not be null)
      onMatch - the value to return when the pattern is matched (must not be null)
      Returns:
      true if the pattern is a new unique pattern, or if the pattern exists but the given value is equal to the existing value; false if the pattern exists but the given value is not equal to the existing value
    • addPattern

      boolean addPattern(NameIterator nameIterator, T onMatch)
    • getMatched

      public T getMatched()
    • setMatched

      public void setMatched(T matched)
    • childNames

      public Iterable<String> childNames()
    • getChild

      public ConfigPatternMap<T> getChild(String name)
    • iterator

      public ConfigPatternMap.PatternIterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • addChild

      public void addChild(String childName, ConfigPatternMap<T> child)
    • merge

      public static <T, U, R> ConfigPatternMap<R> merge(ConfigPatternMap<T> param0, ConfigPatternMap<U> param1, BiFunction<T,U,R> combinator)