Interface SerializationService

  • All Implemented Interfaces:

    @DoNotImplement() 
    public interface SerializationService
    
                        

    Allows flows to serialize and deserialize objects to/from byte arrays.

    Objects are serialized and deserialized using AMQP serialization.

    Corda provides an instance of SerializationService to flows via property injection.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract <T> SerializedBytes<T> serialize(@NotNull() T obj) Serializes the input obj.
      abstract <T> T deserialize(@NotNull() SerializedBytes<T> serializedBytes, @NotNull() Class<T> clazz) Deserializes the input serialized bytes into an object of type .
      abstract <T> T deserialize(@NotNull() Array<byte> bytes, @NotNull() Class<T> clazz) Deserializes the input serialized bytes into an object of type .
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • serialize

        @NotNull() abstract <T> SerializedBytes<T> serialize(@NotNull() T obj)

        Serializes the input obj.

        Parameters:
        obj - The object to serialize.
      • deserialize

        @NotNull() abstract <T> T deserialize(@NotNull() SerializedBytes<T> serializedBytes, @NotNull() Class<T> clazz)

        Deserializes the input serialized bytes into an object of type .

        Parameters:
        serializedBytes - The SerializedBytes to deserialize.
        clazz - Class containing the type to deserialize to.
      • deserialize

        @NotNull() abstract <T> T deserialize(@NotNull() Array<byte> bytes, @NotNull() Class<T> clazz)

        Deserializes the input serialized bytes into an object of type .

        Parameters:
        bytes - The byte[] to deserialize.
        clazz - Class containing the type to deserialize to.