net.spy.memcached.transcoders
Class WhalinV1Transcoder

java.lang.Object
  extended by net.spy.memcached.compat.SpyObject
      extended by net.spy.memcached.transcoders.BaseSerializingTranscoder
          extended by net.spy.memcached.transcoders.WhalinV1Transcoder
All Implemented Interfaces:
Transcoder<Object>

public class WhalinV1Transcoder
extends BaseSerializingTranscoder
implements Transcoder<Object>

Handles old whalin (tested with v1.6) encoding: data type is in the first byte of the value.

Since:
Oct 16, 2008

Field Summary
static int COMPRESSED
           
static int SERIALIZED
           
static int SPECIAL_BOOLEAN
           
static int SPECIAL_BYTE
           
static int SPECIAL_CHARACTER
           
static int SPECIAL_DATE
           
static int SPECIAL_DOUBLE
           
static int SPECIAL_FLOAT
           
static int SPECIAL_INTEGER
           
static int SPECIAL_LONG
           
static int SPECIAL_SHORT
           
static int SPECIAL_STRING
           
static int SPECIAL_STRINGBUFFER
           
static int SPECIAL_STRINGBUILDER
           
 
Fields inherited from class net.spy.memcached.transcoders.BaseSerializingTranscoder
charset, compressionThreshold, DEFAULT_COMPRESSION_THRESHOLD
 
Constructor Summary
WhalinV1Transcoder()
           
 
Method Summary
 Object decode(CachedData d)
          Decode the cached object into the object it represents.
 CachedData encode(Object o)
          Encode the given object for storage.
 
Methods inherited from class net.spy.memcached.transcoders.BaseSerializingTranscoder
asyncDecode, compress, decodeString, decompress, deserialize, encodeString, getMaxSize, serialize, setCharset, setCompressionThreshold
 
Methods inherited from class net.spy.memcached.compat.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.spy.memcached.transcoders.Transcoder
asyncDecode, getMaxSize
 

Field Detail

SPECIAL_BYTE

public static final int SPECIAL_BYTE
See Also:
Constant Field Values

SPECIAL_BOOLEAN

public static final int SPECIAL_BOOLEAN
See Also:
Constant Field Values

SPECIAL_INTEGER

public static final int SPECIAL_INTEGER
See Also:
Constant Field Values

SPECIAL_LONG

public static final int SPECIAL_LONG
See Also:
Constant Field Values

SPECIAL_CHARACTER

public static final int SPECIAL_CHARACTER
See Also:
Constant Field Values

SPECIAL_STRING

public static final int SPECIAL_STRING
See Also:
Constant Field Values

SPECIAL_STRINGBUFFER

public static final int SPECIAL_STRINGBUFFER
See Also:
Constant Field Values

SPECIAL_FLOAT

public static final int SPECIAL_FLOAT
See Also:
Constant Field Values

SPECIAL_SHORT

public static final int SPECIAL_SHORT
See Also:
Constant Field Values

SPECIAL_DOUBLE

public static final int SPECIAL_DOUBLE
See Also:
Constant Field Values

SPECIAL_DATE

public static final int SPECIAL_DATE
See Also:
Constant Field Values

SPECIAL_STRINGBUILDER

public static final int SPECIAL_STRINGBUILDER
See Also:
Constant Field Values

COMPRESSED

public static final int COMPRESSED
See Also:
Constant Field Values

SERIALIZED

public static final int SERIALIZED
See Also:
Constant Field Values
Constructor Detail

WhalinV1Transcoder

public WhalinV1Transcoder()
Method Detail

encode

public CachedData encode(Object o)
Description copied from interface: Transcoder
Encode the given object for storage.

Specified by:
encode in interface Transcoder<Object>
Parameters:
o - the object
Returns:
the CachedData representing what should be sent

decode

public Object decode(CachedData d)
Description copied from interface: Transcoder
Decode the cached object into the object it represents.

Specified by:
decode in interface Transcoder<Object>
Parameters:
d - the data
Returns:
the return value