Class ByteCodec

  • All Implemented Interfaces:
    Codec<java.lang.Byte>

    public final class ByteCodec
    extends BaseCodec<java.lang.Byte>
    Codec for encoding and decoding Byte values in Fauna's tagged data format.
    • Field Detail

      • SINGLETON

        public static final ByteCodec SINGLETON
    • Constructor Detail

      • ByteCodec

        public ByteCodec()
    • Method Detail

      • decode

        public java.lang.Byte decode​(UTF8FaunaParser parser)
                              throws CodecException
        Decodes a Byte from the parser.
        Parameters:
        parser - the parser to read from
        Returns:
        the decoded Byte value, or null if the token represents a null value
        Throws:
        CodecException - if decoding fails due to an unexpected type
      • encode

        public void encode​(UTF8FaunaGenerator gen,
                           java.lang.Byte obj)
                    throws CodecException
        Encodes a Byte value to the generator.
        Parameters:
        gen - the generator to write to
        obj - the Byte value to encode
        Throws:
        CodecException - if encoding fails
      • getCodecClass

        public java.lang.Class<java.lang.Byte> getCodecClass()
        Returns the class type this codec supports.
        Returns:
        Byte class
      • getSupportedTypes

        public FaunaType[] getSupportedTypes()
        Returns the Fauna types this codec supports.
        Returns:
        supported Fauna types