public static class TypePool.CacheProvider.Discriminating extends Object implements TypePool.CacheProvider
TypePool.CacheProvider.Discriminating, TypePool.CacheProvider.NoOp, TypePool.CacheProvider.Simple
UNRESOLVED
Constructor and Description |
---|
Discriminating(ElementMatcher<String> matcher,
TypePool.CacheProvider matched,
TypePool.CacheProvider unmatched)
Creates a new discriminating cache provider.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears this cache.
|
TypePool.Resolution |
find(String name)
Attempts to find a resolution in this cache.
|
TypePool.Resolution |
register(String name,
TypePool.Resolution resolution)
Registers a resolution in this cache.
|
public Discriminating(ElementMatcher<String> matcher, TypePool.CacheProvider matched, TypePool.CacheProvider unmatched)
matcher
- The matcher that determines which cache to use.matched
- The cache provider to use for matched types.unmatched
- The cache provider to use for unmatched types.@MaybeNull public TypePool.Resolution find(String name)
find
in interface TypePool.CacheProvider
name
- The name of the type to describe.null
if no such resolution can be found in the cache.public TypePool.Resolution register(String name, TypePool.Resolution resolution)
register
in interface TypePool.CacheProvider
name
- The name of the type that is to be registered.resolution
- The resolution to register.public void clear()
clear
in interface TypePool.CacheProvider
Copyright © 2014–2024. All rights reserved.