net.spy.memcached.transcoders
Interface Transcoder<T>

All Known Implementing Classes:
IntegerTranscoder, LongTranscoder, SerializingTranscoder, WhalinTranscoder, WhalinV1Transcoder

public interface Transcoder<T>

Transcoder is an interface for classes that convert between byte arrays and objects for storage in the cache.


Method Summary
 boolean asyncDecode(CachedData d)
          Should the transcoder be run asyncronously.
 T decode(CachedData d)
          Decode the cached object into the object it represents.
 CachedData encode(T o)
          Encode the given object for storage.
 int getMaxSize()
          Get the maximum size of objects handled by this transcoder.
 

Method Detail

asyncDecode

boolean asyncDecode(CachedData d)
Should the transcoder be run asyncronously.

Returns:
True if the CachedData should be decoded Asyncronously

encode

CachedData encode(T o)
Encode the given object for storage.

Parameters:
o - the object
Returns:
the CachedData representing what should be sent

decode

T decode(CachedData d)
Decode the cached object into the object it represents.

Parameters:
d - the data
Returns:
the return value

getMaxSize

int getMaxSize()
Get the maximum size of objects handled by this transcoder.