ValueSerializer (Apache Geode 1.12.3)
Date: 2021-06-11

org.apache.geode.experimental.driver

## Interface ValueSerializer

- All Known Implementing Classes:
    NoOpSerializer

      @Experimental
      public interface ValueSerializer

  Interface for controlling serialization format of all values transmitted using the protobuf based client-server protocol. Use this serializer by calling `DriverFactory.setValueSerializer(ValueSerializer)` On the server side, there must be a registered ValueSerializer with the same id.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `deserialize(com.google.protobuf.ByteString bytes)` Deserialize an object from a byte array.
    `String` | `getID()` Return the id of this value format.
    `com.google.protobuf.ByteString` | `serialize(Object object)` Serialize an object into a byte array.
    `boolean` | `supportsPrimitives()` True if this serializer wants to serialize all values, including primitives like numbers and strings that can be sent as one of the options in EncodedValue.

- - ### Method Detail

    - #### serialize

          com.google.protobuf.ByteString serialize(Object object)
                                            throws IOException

      Serialize an object into a byte array.
      Returns:
        a byte array, or null to fall back on default serialization
      Throws:
        `IOException`

    - #### deserialize

          Object deserialize(com.google.protobuf.ByteString bytes)
                      throws IOException,
                             ClassNotFoundException

      Deserialize an object from a byte array.
      Throws:
        `IOException`
        `ClassNotFoundException`

    - #### getID

          String getID()

      Return the id of this value format. This should match the id of the ValueSerializer registered on the server.

    - #### supportsPrimitives

          boolean supportsPrimitives()

      True if this serializer wants to serialize all values, including primitives like numbers and strings that can be sent as one of the options in EncodedValue.