Class CharCodec

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

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

      • SINGLETON

        public static final CharCodec SINGLETON
    • Constructor Detail

      • CharCodec

        public CharCodec()
    • Method Detail

      • decode

        public java.lang.Character decode​(UTF8FaunaParser parser)
                                   throws CodecException
        Decodes a Character from the parser.
        Parameters:
        parser - the parser to read from
        Returns:
        the decoded Character 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.Character obj)
                    throws CodecException
        Encodes a Character value to the generator.
        Parameters:
        gen - the generator to write to
        obj - the Character value to encode
        Throws:
        CodecException - if encoding fails
      • getCodecClass

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

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