Class AbstractScalarEncoder

  • All Implemented Interfaces:
    TokenEncoder

    public abstract class AbstractScalarEncoder
    extends AbstractTokenEncoder
    Base class for scalar encoders. Handles uniform encoding of null values.
    • Constructor Detail

      • AbstractScalarEncoder

        protected AbstractScalarEncoder()
        Initializes a new encoder.
    • Method Detail

      • encode

        public final void encode​(BinaryBuilder buffer)
        This implementation invokes encodeScalar(BinaryBuilder) in the event that the source is non-null.
        Parameters:
        buffer - the buffer to which to append the encoding
      • encodeScalar

        protected abstract void encodeScalar​(BinaryBuilder buffer)
        Subclasses must override this method to handle the encoding of the value. This method is guaranteed to only be invoked if non-null.
        Parameters:
        buffer - The buffer to encode into.