Class WhalinTranscoder

  • All Implemented Interfaces:
    Transcoder<java.lang.Object>

    public class WhalinTranscoder
    extends BaseSerializingTranscoder
    implements Transcoder<java.lang.Object>
    Transcoder that provides compatibility with Greg Whalin's memcached client.
    • Constructor Detail

      • WhalinTranscoder

        public WhalinTranscoder()
      • WhalinTranscoder

        public WhalinTranscoder​(int maxSize)
    • Method Detail

      • setPackZeros

        public void setPackZeros​(boolean packZeros)
        Description copied from interface: Transcoder
        Set whether pack zeros
        Specified by:
        setPackZeros in interface Transcoder<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 interface Transcoder<java.lang.Object>
      • getMaxSize

        public final int getMaxSize()
      • setMaxSize

        public final void setMaxSize​(int maxSize)
      • isPackZeros

        public boolean isPackZeros()
        Description copied from interface: Transcoder
        Returns if transcoder packs zero.
        Specified by:
        isPackZeros in interface Transcoder<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 interface Transcoder<java.lang.Object>
        Returns:
      • decode

        public java.lang.Object decode​(CachedData d)
        Description copied from interface: Transcoder
        Decode the cached object into the object it represents.
        Specified by:
        decode in interface Transcoder<java.lang.Object>
        Parameters:
        d - the data
        Returns:
        the return value
      • encode

        public CachedData encode​(java.lang.Object o)
        Description copied from interface: Transcoder
        Encode the given object for storage.
        Specified by:
        encode in interface Transcoder<java.lang.Object>
        Parameters:
        o - the object
        Returns:
        the CachedData representing what should be sent
      • decodeCharacter

        protected java.lang.Character decodeCharacter​(byte[] b)
      • encodeBoolean

        public byte[] encodeBoolean​(boolean b)
      • decodeBoolean

        public boolean decodeBoolean​(byte[] in)