Interface ObjectSerializer

  • All Known Subinterfaces:
    JsonSerializer

    public interface ObjectSerializer
    Generic interface covering serializing and deserialization objects.
    • Method Detail

      • deserializeFromBytes

        default <T> T deserializeFromBytes​(byte[] data,
                                           TypeReference<T> typeReference)
        Reads a byte array into its object representation.
        Type Parameters:
        T - Type of the object.
        Parameters:
        data - Byte array.
        typeReference - TypeReference representing the object.
        Returns:
        The object represented by the deserialized byte array.
      • deserialize

        <T> T deserialize​(InputStream stream,
                          TypeReference<T> typeReference)
        Reads a stream into its object representation.
        Type Parameters:
        T - Type of the object.
        Parameters:
        stream - InputStream of data.
        typeReference - TypeReference representing the object.
        Returns:
        The object represented by the deserialized stream.
      • deserializeFromBytesAsync

        default <T> Mono<T> deserializeFromBytesAsync​(byte[] data,
                                                      TypeReference<T> typeReference)
        Reads a byte array into its object representation.
        Type Parameters:
        T - Type of the object.
        Parameters:
        data - Byte array.
        typeReference - TypeReference representing the object.
        Returns:
        Reactive stream that emits the object represented by the deserialized byte array.
      • deserializeAsync

        <T> Mono<T> deserializeAsync​(InputStream stream,
                                     TypeReference<T> typeReference)
        Reads a stream into its object representation.
        Type Parameters:
        T - Type of the object.
        Parameters:
        stream - InputStream of data.
        typeReference - TypeReference representing the object.
        Returns:
        Reactive stream that emits the object represented by the deserialized stream.
      • serializeToBytes

        default byte[] serializeToBytes​(Object value)
        Converts the object into a byte array.
        Parameters:
        value - The object.
        Returns:
        The binary representation of the serialized object.
      • serialize

        void serialize​(OutputStream stream,
                       Object value)
        Writes the serialized object into a stream.
        Parameters:
        stream - OutputStream where the serialized object will be written.
        value - The object.
      • serializeToBytesAsync

        default Mono<byte[]> serializeToBytesAsync​(Object value)
        Converts the object into a byte array.
        Parameters:
        value - The object.
        Returns:
        Reactive stream that emits the binary representation of the serialized object.
      • serializeAsync

        Mono<Void> serializeAsync​(OutputStream stream,
                                  Object value)
        Writes the serialized object into a stream.
        Parameters:
        stream - OutputStream where the serialized object will be written.
        value - The object.
        Returns:
        Reactive stream that will indicate operation completion.