Class TokyoTyrantTranscoder
- java.lang.Object
-
- net.rubyeye.xmemcached.transcoders.TokyoTyrantTranscoder
-
- All Implemented Interfaces:
Transcoder<java.lang.Object>
public class TokyoTyrantTranscoder extends java.lang.Object implements Transcoder<java.lang.Object>
Transcoder for TokyoTyrant.Add 4-bytes flag before value.
-
-
Field Summary
Fields Modifier and Type Field Description private SerializingTranscoder
serializingTranscoder
-
Constructor Summary
Constructors Constructor Description TokyoTyrantTranscoder()
TokyoTyrantTranscoder(int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
decode(CachedData d)
Decode the cached object into the object it represents.CachedData
encode(java.lang.Object o)
Encode the given object for storage.int
getMaxSize()
boolean
isPackZeros()
Returns if transcoder packs zero.boolean
isPrimitiveAsString()
Returns if client stores primitive type as string.void
setCharset(java.lang.String to)
void
setCompressionMode(CompressionMode compressMode)
Set compress mode,default is ZIPvoid
setCompressionThreshold(int to)
Set compression threshold in bytesvoid
setPackZeros(boolean packZeros)
Set whether pack zerosvoid
setPrimitiveAsString(boolean primitiveAsString)
Set whether store primitive type as string.
-
-
-
Field Detail
-
serializingTranscoder
private final SerializingTranscoder serializingTranscoder
-
-
Method Detail
-
decode
public final java.lang.Object decode(CachedData d)
Description copied from interface:Transcoder
Decode the cached object into the object it represents.- Specified by:
decode
in interfaceTranscoder<java.lang.Object>
- Parameters:
d
- the data- Returns:
- the return value
-
setCompressionMode
public void setCompressionMode(CompressionMode compressMode)
Description copied from interface:Transcoder
Set compress mode,default is ZIP- Specified by:
setCompressionMode
in interfaceTranscoder<java.lang.Object>
- See Also:
CompressionMode
-
encode
public final CachedData encode(java.lang.Object o)
Description copied from interface:Transcoder
Encode the given object for storage.- Specified by:
encode
in interfaceTranscoder<java.lang.Object>
- Parameters:
o
- the object- Returns:
- the CachedData representing what should be sent
-
getMaxSize
public final int getMaxSize()
-
isPackZeros
public boolean isPackZeros()
Description copied from interface:Transcoder
Returns if transcoder packs zero.- Specified by:
isPackZeros
in interfaceTranscoder<java.lang.Object>
- Returns:
-
isPrimitiveAsString
public boolean isPrimitiveAsString()
Description copied from interface:Transcoder
Returns if client stores primitive type as string.- Specified by:
isPrimitiveAsString
in interfaceTranscoder<java.lang.Object>
- Returns:
-
setCharset
public void setCharset(java.lang.String to)
-
setCompressionThreshold
public void setCompressionThreshold(int to)
Description copied from interface:Transcoder
Set compression threshold in bytes- Specified by:
setCompressionThreshold
in interfaceTranscoder<java.lang.Object>
-
setPackZeros
public void setPackZeros(boolean packZeros)
Description copied from interface:Transcoder
Set whether pack zeros- Specified by:
setPackZeros
in interfaceTranscoder<java.lang.Object>
-
setPrimitiveAsString
public void setPrimitiveAsString(boolean primitiveAsString)
Description copied from interface:Transcoder
Set whether store primitive type as string.- Specified by:
setPrimitiveAsString
in interfaceTranscoder<java.lang.Object>
-
-