Package dev.orne.beans
Class BeanAnnotationFinder.WeakHashMapCache
java.lang.Object
dev.orne.beans.BeanAnnotationFinder.WeakHashMapCache
- All Implemented Interfaces:
BeanAnnotationFinder.Cache
- Enclosing class:
- BeanAnnotationFinder<T extends Annotation,
L extends Annotation>
@API(status=INTERNAL,
since="0.1")
protected static class BeanAnnotationFinder.WeakHashMapCache
extends Object
implements BeanAnnotationFinder.Cache
Implementation of
Cache based on WeakHashMap.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(@NotNull BeanAnnotationFinder.CacheEntryKey<?> key) Returnstrueif this instance contains an entry for the specified key.<T extends Annotation>
Set<T>get(@NotNull BeanAnnotationFinder.CacheEntryKey<T> key) Returns the cached found annotations for the specified key, if any.<T extends Annotation>
voidput(@NotNull BeanAnnotationFinder.CacheEntryKey<T> key, @NotNull Set<T> value) Puts the specified found annotations for the specified key.
-
Constructor Details
-
WeakHashMapCache
public WeakHashMapCache()Creates a new instance.
-
-
Method Details
-
contains
Returnstrueif this instance contains an entry for the specified key.- Specified by:
containsin interfaceBeanAnnotationFinder.Cache- Parameters:
key- The cache entry key- Returns:
- If this instance contains an entry for the key
-
put
@NotNull public <T extends Annotation> void put(@NotNull @NotNull BeanAnnotationFinder.CacheEntryKey<T> key, @NotNull @NotNull Set<T> value) Puts the specified found annotations for the specified key.- Specified by:
putin interfaceBeanAnnotationFinder.Cache- Type Parameters:
T- The type of annotations- Parameters:
key- The cache entry keyvalue- The annotations found
-
get
public <T extends Annotation> Set<T> get(@NotNull @NotNull BeanAnnotationFinder.CacheEntryKey<T> key) Returns the cached found annotations for the specified key, if any.- Specified by:
getin interfaceBeanAnnotationFinder.Cache- Type Parameters:
T- The type of annotations- Parameters:
key- The cache entry key- Returns:
- The annotations found, or
nullif not cached o cache expired
-