S
- The actual matched type of this matcher.public static class CachingMatcher.WithInlineEviction<S> extends CachingMatcher<S>
CachingMatcher.WithInlineEviction<S>
ElementMatcher.Junction.AbstractBase<V>, ElementMatcher.Junction.Conjunction<W>, ElementMatcher.Junction.Disjunction<W>
ElementMatcher.Junction<S>
map
Constructor and Description |
---|
WithInlineEviction(ElementMatcher<? super S> matcher,
ConcurrentMap<? super S,Boolean> map,
int evictionSize)
Creates a new caching matcher with inlined cache eviction.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
onCacheMiss(S target)
Invoked if the cache is not hit.
|
matches, toString
and, or
public WithInlineEviction(ElementMatcher<? super S> matcher, ConcurrentMap<? super S,Boolean> map, int evictionSize)
matcher
- The underlying matcher to apply for non-cached targets.map
- A map that serves as a cache for previous matches. This match is strongly referenced and
can cause a memory leak if it is not evicted while keeping this matcher alive.evictionSize
- The maximum amount of entries in this map before removing a random entry from the map.protected boolean onCacheMiss(S target)
CachingMatcher
onCacheMiss
in class CachingMatcher<S>
target
- The element to be matched.true
if the element is matched.Copyright © 2014–2018. All rights reserved.