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