Class ConfigPatternMap<T>
- java.lang.Object
-
- io.quarkus.deployment.configuration.matching.ConfigPatternMap<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConfigPatternMap.PatternIterator<T>
-
Constructor Summary
Constructors Constructor Description ConfigPatternMap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(String childName, ConfigPatternMap<T> child)
(package private) boolean
addPattern(NameIterator nameIterator, T onMatch)
boolean
addPattern(String pattern, T onMatch)
Add a pattern to the map.Iterable<String>
childNames()
ConfigPatternMap<T>
getChild(String name)
T
getMatched()
ConfigPatternMap.PatternIterator<T>
iterator()
T
match(NameIterator nameIterator)
Find the item which matches the given configuration key iterator.T
match(String name)
Find the item which matches the given configuration key.(package private) T
matchLeaf(NameIterator nameIterator)
static <T,U,R>
ConfigPatternMap<R>merge(ConfigPatternMap<T> param0, ConfigPatternMap<U> param1, BiFunction<T,U,R> combinator)
void
setMatched(T matched)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
WILD_CARD
public static final String WILD_CARD
- See Also:
- Constant Field Values
-
-
Method Detail
-
match
public T match(String name)
Find the item which matches the given configuration key.- Parameters:
name
- the configuration key (must not benull
)- 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 benull
)- 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 benull
)onMatch
- the value to return when the pattern is matched (must not benull
)- 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)
-
getChild
public ConfigPatternMap<T> getChild(String name)
-
iterator
public ConfigPatternMap.PatternIterator<T> iterator()
-
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)
-
-