Class SerializingTranscoder
java.lang.Object
net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder
net.rubyeye.xmemcached.transcoders.SerializingTranscoder
- All Implemented Interfaces:
Transcoder<Object>
Transcoder that serializes and compresses objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate final intprivate booleanstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprivate final TranscoderUtilsFields inherited from class net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder
charset, COMPRESS_RATIO, compressionThreshold, compressMode, DEFAULT_CHARSET, DEFAULT_COMPRESSION_THRESHOLD, log -
Constructor Summary
ConstructorsConstructorDescriptionGet a serializing transcoder with the default max data size.SerializingTranscoder(int max) Get a serializing transcoder that specifies the max data size. -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectdecode(CachedData d) Decode the cached object into the object it represents.protected final Objectdecode0(CachedData cachedData, byte[] data, int flags) final CachedDataEncode the given object for storage.final intbooleanReturns if transcoder packs zero.booleanReturns if client stores primitive type as string.voidsetPackZeros(boolean packZeros) Set whether pack zerosvoidsetPrimitiveAsString(boolean primitiveAsString) Set whether store primitive type as string.Methods inherited from class net.rubyeye.xmemcached.transcoders.BaseSerializingTranscoder
compress, decodeString, decompress, deserialize, encodeString, getCompressMode, serialize, setCharset, setCompressionMode, setCompressionThresholdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.rubyeye.xmemcached.transcoders.Transcoder
setCompressionMode, setCompressionThreshold
-
Field Details
-
maxSize
private final int maxSize -
primitiveAsString
private boolean primitiveAsString -
SERIALIZED
public static final int SERIALIZED- See Also:
-
COMPRESSED
public static final int COMPRESSED- See Also:
-
SPECIAL_MASK
public static final int SPECIAL_MASK- See Also:
-
SPECIAL_BOOLEAN
public static final int SPECIAL_BOOLEAN- See Also:
-
SPECIAL_INT
public static final int SPECIAL_INT- See Also:
-
SPECIAL_LONG
public static final int SPECIAL_LONG- See Also:
-
SPECIAL_DATE
public static final int SPECIAL_DATE- See Also:
-
SPECIAL_BYTE
public static final int SPECIAL_BYTE- See Also:
-
SPECIAL_FLOAT
public static final int SPECIAL_FLOAT- See Also:
-
SPECIAL_DOUBLE
public static final int SPECIAL_DOUBLE- See Also:
-
SPECIAL_BYTEARRAY
public static final int SPECIAL_BYTEARRAY- See Also:
-
transcoderUtils
-
-
Constructor Details
-
SerializingTranscoder
public SerializingTranscoder()Get a serializing transcoder with the default max data size. -
SerializingTranscoder
public SerializingTranscoder(int max) Get a serializing transcoder that specifies the max data size.
-
-
Method Details
-
setPackZeros
public void setPackZeros(boolean packZeros) Description copied from interface:TranscoderSet whether pack zeros- Specified by:
setPackZerosin interfaceTranscoder<Object>
-
setPrimitiveAsString
public void setPrimitiveAsString(boolean primitiveAsString) Description copied from interface:TranscoderSet whether store primitive type as string.- Specified by:
setPrimitiveAsStringin interfaceTranscoder<Object>- Parameters:
primitiveAsString-
-
getMaxSize
public final int getMaxSize() -
getTranscoderUtils
-
isPackZeros
public boolean isPackZeros()Description copied from interface:TranscoderReturns if transcoder packs zero.- Specified by:
isPackZerosin interfaceTranscoder<Object>- Returns:
-
isPrimitiveAsString
public boolean isPrimitiveAsString()Description copied from interface:TranscoderReturns if client stores primitive type as string.- Specified by:
isPrimitiveAsStringin interfaceTranscoder<Object>- Returns:
-
decode
Description copied from interface:TranscoderDecode the cached object into the object it represents.- Specified by:
decodein interfaceTranscoder<Object>- Parameters:
d- the data- Returns:
- the return value
-
decode0
-
encode
Description copied from interface:TranscoderEncode the given object for storage.- Specified by:
encodein interfaceTranscoder<Object>- Parameters:
o- the object- Returns:
- the CachedData representing what should be sent
-