Class CacheKey

java.lang.Object
org.jvnet.hk2.internal.CacheKey

public class CacheKey extends Object
This is the cache key, which encapsulates very specific lookup queries. The point of this is to be useable as the key in a hash map, so that equals and hashCode must work properly
  • Field Details

    • removalName

      private final String removalName
    • lookupType

      private final Type lookupType
    • name

      private final String name
    • qualifiers

      private final Annotation[] qualifiers
    • unqualified

      private final Unqualified unqualified
    • hashCode

      private final int hashCode
      Pre-calculated in order to improve hashMap lookups
  • Constructor Details

    • CacheKey

      public CacheKey(Type lookupType, String name, Unqualified unqualified, Annotation... qualifiers)
      Key used for LRU cache
      Parameters:
      lookupType - The type in the lookup call
      name - The name in the lookup call
      qualifiers - The set of qualifiers being looked up
  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • matchesRemovalName

      public boolean matchesRemovalName(String name)
      Used when bulk removing a contract that has been removed from the system
      Parameters:
      name - The name of the contract that has been removed from the system
      Returns:
      true if this CacheKey is associated with the name contract, and should thus be removed
    • toString

      public String toString()
      Overrides:
      toString in class Object