Interface DaprObjectSerializer

  • All Known Implementing Classes:
    DefaultObjectSerializer

    public interface DaprObjectSerializer
    Serializes and deserializes application's objects.
    • Method Detail

      • serialize

        byte[] serialize​(Object o)
                  throws IOException
        Serializes the given object as byte[].
        Parameters:
        o - Object to be serialized.
        Returns:
        Serialized object.
        Throws:
        IOException - If cannot serialize.
      • deserialize

        <T> T deserialize​(byte[] data,
                          TypeRef<T> type)
                   throws IOException
        Deserializes the given byte[] into a object.
        Type Parameters:
        T - Type of object to be deserialized.
        Parameters:
        data - Data to be deserialized.
        type - Type of object to be deserialized.
        Returns:
        Deserialized object.
        Throws:
        IOException - If cannot deserialize object.
      • getContentType

        String getContentType()
        Returns the content type of the request.
        Returns:
        content type of the request