java.lang.Object
io.smallrye.config.PropertyNamesMatcher<T>
- Direct Known Subclasses:
DefaultValuesConfigSource.Defaults
A matcher of configuration names.
Names without wildcards are stored in a HashMap for exact lookup. Names containing * or
** are stored in a trie of PropertyNamesMatcher.Node instances, where each node represents a segment separated by
.. Single * segments are stored in the PropertyNamesMatcher.Node.wildcard, and ** sets the
PropertyNamesMatcher.Node.greedy flag to match any number of remaining segments.
Lookups (matches(java.lang.String) and get(java.lang.String)) first check the exact-match map, then traverse the wildcard trie,
trying named children before falling back to wildcard nodes at each level.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidprotected voidReturns the value matching a name with any of the names contained in this matcher.protected PropertyNamesMatcher.Node<T> booleanisEmpty()booleanMatch a name with any of the names contained in this matcher.protected voidprotected void
-
Constructor Details
-
PropertyNamesMatcher
protected PropertyNamesMatcher()
-
-
Method Details
-
getProperties
-
getWildcards
-
isEmpty
public boolean isEmpty() -
matches
Match a name with any of the names contained in this matcher.- Parameters:
name- the String to be matched- Returns:
trueif matched orfalseotherwise.
-
get
Returns the value matching a name with any of the names contained in this matcher.- Parameters:
name- the String to be matched- Returns:
- a
Tvalue if the name matches ornullotherwise.
-
add
-
add
-
add
-
add
-
put
-
put
-