Class MatcherLookup
The lookup doesn't target to speed up lookup for non exact pattern matcher. All non exact matchers are placed in non-keyed collection.
At lookup for matchers against specific module, all non exact pattern matchers are iterated to match with module attributes, and exact pattern matchers binding to the same key will also iterated to match with module attributes.
If there are much more exact pattern matchers than non exact pattern matchers, the matcher lookup speed can benefit from this class significantly. A quick example could be user declares lots of dependencyOverrides which are typically exact pattern matchers.
If there are balanced exact and non exact pattern matchers, the matcher lookup speed doesn't hurt by this class.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
MatcherLookup
public MatcherLookup()
-
-
Method Details
-
add
Add matcher. If matcher is exact pattern matcher, it will be associated with a key and placed in keyed collection. If matcher is not exact pattern matcher, it will be placed into non-keyed collection- Parameters:
matcher
- MapMatcher
-
get
- Parameters:
attrs
- A map of attributes that matcher should match.- Returns:
- a list of matchers that can apply to module withs specified attributes
-