@FunctionalInterface @ParametersAreNonnullByDefault public interface StructuredMessageReader
| Modifier and Type | Method and Description |
|---|---|
static StructuredMessageReader |
from(CloudEvent event,
EventFormat format)
Create a generic structured message from a
CloudEvent. |
static StructuredMessageReader |
from(CloudEvent event,
String contentType)
Create a generic structured message from a
CloudEvent. |
<R> R |
read(StructuredMessageWriter<R> writer)
Read self using the provided writer.
|
default CloudEvent |
toEvent() |
default CloudEvent |
toEvent(CloudEventDataMapper<? extends CloudEventData> mapper) |
<R> R read(StructuredMessageWriter<R> writer) throws CloudEventRWException, IllegalStateException
R - the return type of the StructuredMessageWriterwriter - the writer to use to write out the messageStructuredMessageWriter.setEvent(EventFormat, byte[])CloudEventRWException - If something went wrong whenIllegalStateException - If the message is not a valid structured messagedefault CloudEvent toEvent() throws CloudEventRWException, IllegalStateException
default CloudEvent toEvent(CloudEventDataMapper<? extends CloudEventData> mapper) throws CloudEventRWException, IllegalStateException
static StructuredMessageReader from(CloudEvent event, String contentType)
CloudEvent.event - the event to convert to StructuredMessageReadercontentType - content type to use to resolve the EventFormatstatic StructuredMessageReader from(CloudEvent event, EventFormat format)
CloudEvent.event - the event to convert to StructuredMessageReaderformat - the format to use to perform the conversionCopyright © 2024. All rights reserved.