org.apache.tinkerpop.gremlin.structure.io.binary.types

## Class SingleTypeSerializer<T>

- java.lang.Object
- - org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer<T>
  - - org.apache.tinkerpop.gremlin.structure.io.binary.types.SingleTypeSerializer<T>

- All Implemented Interfaces:
    TypeSerializer<T>

      public class SingleTypeSerializer<T>
      extends SimpleTypeSerializer<T>

  Represents a serializer for types that can be represented as a single value and that can be read and write in a single operation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static SingleTypeSerializer<Boolean>` | `BooleanSerializer`
    `static SingleTypeSerializer<Byte>` | `ByteSerializer`
    `static SingleTypeSerializer<Double>` | `DoubleSerializer`
    `static SingleTypeSerializer<Float>` | `FloatSerializer`
    `static SingleTypeSerializer<Integer>` | `IntSerializer`
    `static SingleTypeSerializer<Long>` | `LongSerializer`
    `static SingleTypeSerializer<Short>` | `ShortSerializer`
    `static SingleTypeSerializer<Year>` | `YearSerializer`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `readValue(Buffer buffer, GraphBinaryReader context)` Reads a non-nullable value according to the type format.
    `protected void` | `writeValue(T value, Buffer buffer, GraphBinaryWriter context)` Writes a non-nullable value into a buffer using the provided allocator.

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.structure.io.binary.types.SimpleTypeSerializer

      `getDataType, read, readValue, write, writeValue`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### IntSerializer

          public static final SingleTypeSerializer<Integer> IntSerializer

    - #### LongSerializer

          public static final SingleTypeSerializer<Long> LongSerializer

    - #### DoubleSerializer

          public static final SingleTypeSerializer<Double> DoubleSerializer

    - #### FloatSerializer

          public static final SingleTypeSerializer<Float> FloatSerializer

    - #### ShortSerializer

          public static final SingleTypeSerializer<Short> ShortSerializer

    - #### BooleanSerializer

          public static final SingleTypeSerializer<Boolean> BooleanSerializer

    - #### ByteSerializer

          public static final SingleTypeSerializer<Byte> ByteSerializer

    - #### YearSerializer

          public static final SingleTypeSerializer<Year> YearSerializer

  - ### Method Detail

    - #### readValue

          public T readValue(Buffer buffer,
                             GraphBinaryReader context)

      Description copied from class: `SimpleTypeSerializer`
      Reads a non-nullable value according to the type format.
      Specified by:
        `readValue` in class `SimpleTypeSerializer<T>`
      Parameters:
        `buffer` - A buffer which reader index has been set to the beginning of the {value}.
        `context` - The binary reader.
      Returns:

    - #### writeValue

          protected void writeValue(T value,
                                    Buffer buffer,
                                    GraphBinaryWriter context)

      Description copied from class: `SimpleTypeSerializer`
      Writes a non-nullable value into a buffer using the provided allocator.
      Specified by:
        `writeValue` in class `SimpleTypeSerializer<T>`
      Parameters:
        `value` - A non-nullable value.
        `buffer` - The buffer allocator to use.
        `context` - The binary writer.

Copyright © 2013–2021 Apache Software Foundation. All rights reserved.