Class AbstractCacheKey

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int cachedHash  
      protected java.lang.String tenantId  
      protected java.lang.Object typeCode
      Each key has value and type.
      protected CacheUnitValueType valueType
      Defines if associated value is SERIALIZABLE or NON_SERIALIZABLE.
    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractCacheKey​(CacheUnitValueType valueType, java.lang.Object typeCode, java.lang.String tenantId)
      Creates key for supplied type and value type.
      AbstractCacheKey​(java.lang.Object typeCode, java.lang.String tenantId)
      Creates NON_SERIALIZABLE key for supplied type.
    • Field Detail

      • valueType

        protected final CacheUnitValueType valueType
        Defines if associated value is SERIALIZABLE or NON_SERIALIZABLE.
        By the default values are considered NON_SERIALIZABLE. This should change in hybris 5.
      • tenantId

        protected final java.lang.String tenantId
      • cachedHash

        protected int cachedHash
      • typeCode

        protected final java.lang.Object typeCode
        Each key has value and type. This field keeps type.
    • Constructor Detail

      • AbstractCacheKey

        public AbstractCacheKey​(java.lang.Object typeCode,
                                java.lang.String tenantId)
        Creates NON_SERIALIZABLE key for supplied type.
      • AbstractCacheKey

        public AbstractCacheKey​(CacheUnitValueType valueType,
                                java.lang.Object typeCode,
                                java.lang.String tenantId)
        Creates key for supplied type and value type.
    • Method Detail

      • getTypeCode

        public java.lang.Object getTypeCode()
        Gets code from typesystem.
        Specified by:
        getTypeCode in interface CacheKey
      • hashCode

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

        public java.lang.String getTenantId()
        Description copied from interface: CacheKey
        Gets tenant
        Specified by:
        getTenantId in interface CacheKey
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object