@ParametersAreNonnullByDefault public interface MessageReader extends StructuredMessageReader, io.cloudevents.rw.CloudEventReader
This class expands the CloudEventReader to define reading both binary and structured messages.
| Modifier and Type | Method and Description |
|---|---|
Encoding |
getEncoding() |
default <W extends io.cloudevents.rw.CloudEventWriter<R>,R> |
read(io.cloudevents.rw.CloudEventWriterFactory<W,R> writerFactory)
Like
read(CloudEventWriterFactory, CloudEventDataMapper), but with the identity CloudEventDataMapper. |
<W extends io.cloudevents.rw.CloudEventWriter<R>,R> |
read(io.cloudevents.rw.CloudEventWriterFactory<W,R> writerFactory,
io.cloudevents.rw.CloudEventDataMapper<? extends io.cloudevents.CloudEventData> mapper)
Read the message as binary encoded message using the provided writer factory.
|
default <BW extends io.cloudevents.rw.CloudEventWriter<R>,R> |
read(MessageWriter<BW,R> writer)
Read the content of this object using a
MessageWriter. |
<R> R |
read(StructuredMessageWriter<R> writer)
Read the message as structured encoded message using the provided writer
|
default io.cloudevents.CloudEvent |
toEvent()
Like
toEvent(CloudEventDataMapper), but with the identity CloudEventDataMapper. |
default io.cloudevents.CloudEvent |
toEvent(io.cloudevents.rw.CloudEventDataMapper<? extends io.cloudevents.CloudEventData> mapper)
Translate this message into a
CloudEvent representation, mapping the data with the provided mapper. |
from, fromdefault <W extends io.cloudevents.rw.CloudEventWriter<R>,R> R read(io.cloudevents.rw.CloudEventWriterFactory<W,R> writerFactory)
throws io.cloudevents.rw.CloudEventRWException,
IllegalStateException
read(CloudEventWriterFactory, CloudEventDataMapper), but with the identity CloudEventDataMapper.read in interface io.cloudevents.rw.CloudEventReaderio.cloudevents.rw.CloudEventRWExceptionIllegalStateExceptionread(CloudEventWriterFactory, CloudEventDataMapper)<W extends io.cloudevents.rw.CloudEventWriter<R>,R> R read(io.cloudevents.rw.CloudEventWriterFactory<W,R> writerFactory,
io.cloudevents.rw.CloudEventDataMapper<? extends io.cloudevents.CloudEventData> mapper)
throws io.cloudevents.rw.CloudEventRWException,
IllegalStateException
read in interface io.cloudevents.rw.CloudEventReaderW - the CloudEventWriter typeR - the return type of the CloudEventWriterwriterFactory - a factory that generates a reader starting from the SpecVersion of the eventmapper - the mapper to use to map the data, if any.io.cloudevents.rw.CloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message is not in binary encoding.<R> R read(StructuredMessageWriter<R> writer) throws io.cloudevents.rw.CloudEventRWException, IllegalStateException
read in interface StructuredMessageReaderR - the return type of the StructuredMessageWriterwriter - Structured Message writerStructuredMessageWriter.setEvent(EventFormat, byte[])io.cloudevents.rw.CloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message is not in structured encoding.Encoding getEncoding()
default <BW extends io.cloudevents.rw.CloudEventWriter<R>,R> R read(MessageWriter<BW,R> writer) throws io.cloudevents.rw.CloudEventRWException, IllegalStateException
MessageWriter. This method allows to transcode an event from one transport to another without
converting it to CloudEvent. The resulting encoding will be the same as the original encoding.BW - the CloudEventWriter typeR - the return type of both CloudEventWriter and StructuredMessageWriterwriter - the MessageWriter accepting this MessageMessageWriterio.cloudevents.rw.CloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message has an unknown encoding.default io.cloudevents.CloudEvent toEvent()
throws io.cloudevents.rw.CloudEventRWException,
IllegalStateException
toEvent(CloudEventDataMapper), but with the identity CloudEventDataMapper.toEvent in interface StructuredMessageReaderio.cloudevents.rw.CloudEventRWExceptionIllegalStateExceptiontoEvent(CloudEventDataMapper)default io.cloudevents.CloudEvent toEvent(io.cloudevents.rw.CloudEventDataMapper<? extends io.cloudevents.CloudEventData> mapper)
throws io.cloudevents.rw.CloudEventRWException,
IllegalStateException
CloudEvent representation, mapping the data with the provided mapper.toEvent in interface StructuredMessageReadermapper - the mapper to use to map the data, if any.CloudEvent with the contents of this message.io.cloudevents.rw.CloudEventRWException - if something went wrong during the read.IllegalStateException - if the message has an unknown encoding.Copyright © 2026. All rights reserved.