org.apache.jcs.engine
Class CacheElementSerialized<K extends Serializable,V extends Serializable>

java.lang.Object
  extended by org.apache.jcs.engine.CacheElementSerialized<K,V>
All Implemented Interfaces:
Serializable, ICacheElement<K,V>, ICacheElementSerialized<K,V>

public class CacheElementSerialized<K extends Serializable,V extends Serializable>
extends Object
implements ICacheElementSerialized<K,V>

Either serialized value or the value should be null;

See Also:
Serialized Form

Constructor Summary
CacheElementSerialized(String cacheNameArg, K keyArg, byte[] serializedValueArg, IElementAttributes elementAttributesArg)
          Constructs a usable wrapper.
 
Method Summary
 String getCacheName()
          Returns the name of the cache.
 IElementAttributes getElementAttributes()
          Gets the attributes attribute of the ICacheElement object
 K getKey()
          Gets the key attribute of the ICacheElementSerialized object.
 byte[] getSerializedValue()
          Gets the value attribute of the ICacheElementSerialized object.
 V getVal()
          Backward compatibility.
 void setElementAttributes(IElementAttributes attr)
          Sets the attributes attribute of the ICacheElement object
 String toString()
          For debugging only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheElementSerialized

public CacheElementSerialized(String cacheNameArg,
                              K keyArg,
                              byte[] serializedValueArg,
                              IElementAttributes elementAttributesArg)
Constructs a usable wrapper.

Parameters:
cacheNameArg -
keyArg -
serializedValueArg -
elementAttributesArg -
Method Detail

getCacheName

public String getCacheName()
Returns the name of the cache. This is the name of the region.

Specified by:
getCacheName in interface ICacheElement<K extends Serializable,V extends Serializable>
Specified by:
getCacheName in interface ICacheElementSerialized<K extends Serializable,V extends Serializable>
Returns:
this.cacheName;

getKey

public K getKey()
Description copied from interface: ICacheElementSerialized
Gets the key attribute of the ICacheElementSerialized object. This is the standard key that the value can be reference by.

Specified by:
getKey in interface ICacheElement<K extends Serializable,V extends Serializable>
Specified by:
getKey in interface ICacheElementSerialized<K extends Serializable,V extends Serializable>
Returns:
Serializable

getSerializedValue

public byte[] getSerializedValue()
Description copied from interface: ICacheElementSerialized
Gets the value attribute of the ICacheElementSerialized object. This is the value the client cached serialized by some mechanism.

Specified by:
getSerializedValue in interface ICacheElementSerialized<K extends Serializable,V extends Serializable>
Returns:
byte[]

getElementAttributes

public IElementAttributes getElementAttributes()
Description copied from interface: ICacheElementSerialized
Gets the attributes attribute of the ICacheElement object

Specified by:
getElementAttributes in interface ICacheElement<K extends Serializable,V extends Serializable>
Specified by:
getElementAttributes in interface ICacheElementSerialized<K extends Serializable,V extends Serializable>
Returns:
IElementAttributes

setElementAttributes

public void setElementAttributes(IElementAttributes attr)
Description copied from interface: ICacheElementSerialized
Sets the attributes attribute of the ICacheElement object

Specified by:
setElementAttributes in interface ICacheElement<K extends Serializable,V extends Serializable>
Specified by:
setElementAttributes in interface ICacheElementSerialized<K extends Serializable,V extends Serializable>
Parameters:
attr -

getVal

public V getVal()
Backward compatibility.

Specified by:
getVal in interface ICacheElement<K extends Serializable,V extends Serializable>
Returns:
Serializable

toString

public String toString()
For debugging only.

Overrides:
toString in class Object
Returns:
debugging string.


Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.