Class AbstractCacheKey
- java.lang.Object
-
- de.hybris.platform.regioncache.key.AbstractCacheKey
-
- All Implemented Interfaces:
CacheKey
- Direct Known Subclasses:
AbstractRegistrableCacheKey
,LegacyCacheKey
,ProductConfigurationCacheKey
,ProductConfigurationEHCacheAccessImplTest.StringCacheKey
,TestCacheKey
public abstract class AbstractCacheKey extends java.lang.Object implements CacheKey
Abstract class used as a base class for regioncache keys.
CacheKey can mark associated value as serializable or nor (CacheUnitType).
CacheKey carries information of type code (String).
Known subtypes:- LegacyCacheKey: used to convert between Object[] and CacheKey
- RegistrableCacheKey: used to mark a cache unit as using cache registry
-
-
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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
CacheUnitValueType
getCacheValueType()
gets value type.java.lang.String
getTenantId()
Gets tenantjava.lang.Object
getTypeCode()
Gets code from typesystem.int
hashCode()
java.lang.String
toString()
-
-
-
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
-
getCacheValueType
public CacheUnitValueType getCacheValueType()
gets value type. Currently not used. To be used in hybris 5.- Specified by:
getCacheValueType
in interfaceCacheKey
-
getTypeCode
public java.lang.Object getTypeCode()
Gets code from typesystem.- Specified by:
getTypeCode
in interfaceCacheKey
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getTenantId
public java.lang.String getTenantId()
Description copied from interface:CacheKey
Gets tenant- Specified by:
getTenantId
in interfaceCacheKey
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-