Class CacheKey


  • public class CacheKey
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      private int hashCode
      Pre-calculated in order to improve hashMap lookups
      private java.lang.reflect.Type lookupType  
      private java.lang.String name  
      private java.lang.annotation.Annotation[] qualifiers  
      private java.lang.String removalName  
      private Unqualified unqualified  
    • Constructor Summary

      Constructors 
      Constructor Description
      CacheKey​(java.lang.reflect.Type lookupType, java.lang.String name, Unqualified unqualified, java.lang.annotation.Annotation... qualifiers)
      Key used for LRU cache
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      boolean matchesRemovalName​(java.lang.String name)
      Used when bulk removing a contract that has been removed from the system
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • removalName

        private final java.lang.String removalName
      • lookupType

        private final java.lang.reflect.Type lookupType
      • name

        private final java.lang.String name
      • qualifiers

        private final java.lang.annotation.Annotation[] qualifiers
      • hashCode

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

      • CacheKey

        public CacheKey​(java.lang.reflect.Type lookupType,
                        java.lang.String name,
                        Unqualified unqualified,
                        java.lang.annotation.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 Detail

      • hashCode

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

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • matchesRemovalName

        public boolean matchesRemovalName​(java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object