Class GenericCacheKey

  • All Implemented Interfaces:
    CacheKey

    public class GenericCacheKey
    extends java.lang.Object
    implements CacheKey
    The GenericCacheKey provides an easy way to handle cache keys, which consist of a list of objects.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_SAP_TYPECODE
      Default typecode used if no other is specified.
    • Constructor Summary

      Constructors 
      Constructor Description
      GenericCacheKey​(java.lang.Object[] keys, java.lang.String typeCode)
      Creates GenericCacheKey for given array of keys and a type code.
      GenericCacheKey​(java.lang.Object[] keys, java.lang.String typeCode, java.lang.String tenant, CacheUnitValueType valueType)
      Creates GenericCacheKey for given array of keys, type code, tenant and value type.
      GenericCacheKey​(java.lang.Object key, java.lang.String typeCode)
      Creates GenericCacheKey for given key and type code.
      GenericCacheKey​(java.lang.Object key, java.lang.String typeCode, java.lang.String tenant, CacheUnitValueType valueType)
      Creates GenericCacheKey for given key, type code, tenant and value type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)
      Returns true, if this object is equal to the provided one.
      CacheUnitValueType getCacheValueType()
      gets value type.
      java.lang.String getTenantId()
      Gets tenant
      java.lang.Object getTypeCode()
      Gets code from typesystem.
      int hashCode()
      Returns the hash code for this object.
      java.lang.String toString()
      Returns the object as string.
      • Methods inherited from class java.lang.Object

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

      • DEFAULT_SAP_TYPECODE

        public static final java.lang.String DEFAULT_SAP_TYPECODE
        Default typecode used if no other is specified.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GenericCacheKey

        public GenericCacheKey​(java.lang.Object[] keys,
                               java.lang.String typeCode)
        Creates GenericCacheKey for given array of keys and a type code.
        Parameters:
        keys - array of key objects
        typeCode - typecode of the GenericCacheKey
      • GenericCacheKey

        public GenericCacheKey​(java.lang.Object[] keys,
                               java.lang.String typeCode,
                               java.lang.String tenant,
                               CacheUnitValueType valueType)
        Creates GenericCacheKey for given array of keys, type code, tenant and value type.
        Parameters:
        keys - array of key objects
        typeCode - typecode of the GenericCacheKey
        tenant - tenant of the GenericCacheKey
        valueType - valuetype of the GenericCacheKey
      • GenericCacheKey

        public GenericCacheKey​(java.lang.Object key,
                               java.lang.String typeCode)
        Creates GenericCacheKey for given key and type code.
        Parameters:
        key - key of the GenericCacheKey
        typeCode - typecode of the GenericCacheKey
      • GenericCacheKey

        public GenericCacheKey​(java.lang.Object key,
                               java.lang.String typeCode,
                               java.lang.String tenant,
                               CacheUnitValueType valueType)
        Creates GenericCacheKey for given key, type code, tenant and value type.
        Parameters:
        key - the key
        typeCode - typecode of the GenericCacheKey
        tenant - tenant of the GenericCacheKey
        valueType - valuetype of the GenericCacheKey
    • Method Detail

      • hashCode

        public int hashCode()
        Returns the hash code for this object.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        Hash code for the object
      • equals

        public boolean equals​(java.lang.Object o)
        Returns true, if this object is equal to the provided one.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - Object to compare this with
        Returns:
        true if both objects are equal, false if not.
      • toString

        public java.lang.String toString()
        Returns the object as string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String which contains all important fields of the object
      • getTenantId

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

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