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 Details

    • WeakHashMapCache

      public WeakHashMapCache()
      Creates a new instance.
  • Method Details

    • contains

      public boolean contains(@NotNull @NotNull BeanAnnotationFinder.CacheEntryKey<?> key)
      Returns true if this instance contains an entry for the specified key.
      Specified by:
      contains in interface BeanAnnotationFinder.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:
      put in interface BeanAnnotationFinder.Cache
      Type Parameters:
      T - The type of annotations
      Parameters:
      key - The cache entry key
      value - 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:
      get in interface BeanAnnotationFinder.Cache
      Type Parameters:
      T - The type of annotations
      Parameters:
      key - The cache entry key
      Returns:
      The annotations found, or null if not cached o cache expired