Interface Serde<T>

    • Method Detail

      • serialize

        byte[] serialize​(@Nullable T value)
      • serializeToByteString

        default com.google.protobuf.ByteString serializeToByteString​(@Nullable T value)
      • deserialize

        T deserialize​(byte[] value)
      • deserialize

        default T deserialize​(com.google.protobuf.ByteString byteString)
      • contentType

        default @Nullable java.lang.String contentType()
        Content-type to use in request/responses.

        If null, the SDK assumes the produced output is empty. This might change in the future.

      • using

        static <T> Serde<T> using​(java.lang.String contentType,
                                  ThrowingFunction<T,​byte[]> serializer,
                                  ThrowingFunction<byte[],​T> deserializer)
        Create a Serde from serializer/deserializer lambdas, tagging with contentType. Before invoking the serializer, we check that value is non-null.
      • withContentType

        static <T> Serde<T> withContentType​(java.lang.String contentType,
                                            Serde<T> inner)