Class DoubleCodec

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

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

    • Constructor Detail

      • DoubleCodec

        public DoubleCodec()
    • Method Detail

      • decode

        public java.lang.Double decode​(UTF8FaunaParser parser)
                                throws CodecException
        Decodes a Double value from the Fauna tagged data format.
        Parameters:
        parser - The parser instance for reading Fauna tagged format data.
        Returns:
        The decoded Double value or null if the token is NULL.
        Throws:
        CodecException - If the token type is unsupported for decoding a Double.
      • encode

        public void encode​(UTF8FaunaGenerator gen,
                           java.lang.Double obj)
                    throws CodecException
        Encodes a Double value to Fauna's tagged data format.
        Parameters:
        gen - The generator used to write Fauna tagged format data.
        obj - The Double value to encode, or null to write a NULL value.
        Throws:
        CodecException - If encoding fails.
      • getCodecClass

        public java.lang.Class<java.lang.Double> getCodecClass()
        Returns the class of the codec, which is Double.
        Returns:
        Double.class.
      • getSupportedTypes

        public FaunaType[] getSupportedTypes()
        Returns the Fauna types supported by this codec.
        Returns:
        An array of FaunaType supported by this codec.