Package net.bytebuddy.pool
Class TypePool.CacheProvider.WithIllegalResolutionReattempt
- java.lang.Object
-
- net.bytebuddy.pool.TypePool.CacheProvider.WithIllegalResolutionReattempt
-
- All Implemented Interfaces:
TypePool.CacheProvider
- Enclosing interface:
- TypePool.CacheProvider
@Enhance public static class TypePool.CacheProvider.WithIllegalResolutionReattempt extends java.lang.Object implements TypePool.CacheProvider
A cache provider wrapper that avoids caching illegal resolutions so that future lookups can be reattempted.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.pool.TypePool.CacheProvider
TypePool.CacheProvider.Discriminating, TypePool.CacheProvider.NoOp, TypePool.CacheProvider.Simple, TypePool.CacheProvider.WithIllegalResolutionReattempt
-
-
Field Summary
Fields Modifier and Type Field Description private TypePool.CacheProviderdelegateThe delegated cache provider.-
Fields inherited from interface net.bytebuddy.pool.TypePool.CacheProvider
UNRESOLVED
-
-
Constructor Summary
Constructors Constructor Description WithIllegalResolutionReattempt(TypePool.CacheProvider delegate)Creates a new cache provider that suppresses caching of illegal resolutions.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears this cache.TypePool.Resolutionfind(java.lang.String name)Attempts to find a resolution in this cache.static TypePool.CacheProviderof(TypePool.CacheProvider cacheProvider)Returns a cache provider that suppresses caching of illegal resolutions without wrapping twice.TypePool.Resolutionregister(java.lang.String name, TypePool.Resolution resolution)Registers a resolution in this cache.
-
-
-
Field Detail
-
delegate
private final TypePool.CacheProvider delegate
The delegated cache provider.
-
-
Constructor Detail
-
WithIllegalResolutionReattempt
public WithIllegalResolutionReattempt(TypePool.CacheProvider delegate)
Creates a new cache provider that suppresses caching of illegal resolutions.- Parameters:
delegate- The cache provider to delegate to.
-
-
Method Detail
-
of
public static TypePool.CacheProvider of(TypePool.CacheProvider cacheProvider)
Returns a cache provider that suppresses caching of illegal resolutions without wrapping twice.- Parameters:
cacheProvider- The cache provider to potentially wrap.- Returns:
- A cache provider that does not store illegal resolutions.
-
find
@MaybeNull public TypePool.Resolution find(java.lang.String name)
Attempts to find a resolution in this cache.- Specified by:
findin interfaceTypePool.CacheProvider- Parameters:
name- The name of the type to describe.- Returns:
- A resolution of the type or
nullif no such resolution can be found in the cache.
-
register
public TypePool.Resolution register(java.lang.String name, TypePool.Resolution resolution)
Registers a resolution in this cache. If a resolution to the given name already exists in the cache, it should be discarded.- Specified by:
registerin interfaceTypePool.CacheProvider- Parameters:
name- The name of the type that is to be registered.resolution- The resolution to register.- Returns:
- The oldest version of a resolution that is currently registered in the cache which might be the given resolution or another resolution that was previously registered.
-
clear
public void clear()
Clears this cache.- Specified by:
clearin interfaceTypePool.CacheProvider
-
-