public final class CloudEventUtils extends Object
io.cloudevents related interfaces| Modifier and Type | Method and Description |
|---|---|
static <R extends io.cloudevents.CloudEventData> |
mapData(io.cloudevents.CloudEvent event,
io.cloudevents.rw.CloudEventDataMapper<R> mapper)
Get the data contained in
event and map it using the provided mapper. |
static io.cloudevents.rw.CloudEventContextReader |
toContextReader(io.cloudevents.CloudEventContext event)
Convert a
CloudEvent to a CloudEventContextReader. |
static io.cloudevents.CloudEvent |
toEvent(io.cloudevents.rw.CloudEventReader reader)
Convert a
CloudEventReader to a CloudEvent. |
static io.cloudevents.CloudEvent |
toEvent(io.cloudevents.rw.CloudEventReader reader,
io.cloudevents.rw.CloudEventDataMapper<?> mapper)
Convert a
CloudEventReader to a CloudEvent mapping the data with the provided mapper. |
static io.cloudevents.rw.CloudEventReader |
toReader(io.cloudevents.CloudEvent event)
Convert a
CloudEvent to a CloudEventReader. |
public static io.cloudevents.rw.CloudEventReader toReader(io.cloudevents.CloudEvent event)
CloudEvent to a CloudEventReader. This method provides a default implementation
for CloudEvent that doesn't implement CloudEventReader.
It's safe to use the returned CloudEventReader multiple times.
event - the event to convertpublic static io.cloudevents.rw.CloudEventContextReader toContextReader(io.cloudevents.CloudEventContext event)
CloudEvent to a CloudEventContextReader. This method provides a default implementation
for CloudEvent that doesn't implement CloudEventContextReader.
It's safe to use the returned CloudEventReader multiple times.
event - the event to convertpublic static io.cloudevents.CloudEvent toEvent(io.cloudevents.rw.CloudEventReader reader)
throws io.cloudevents.rw.CloudEventRWException
CloudEventReader to a CloudEvent.reader - the reader where to read the message fromio.cloudevents.rw.CloudEventRWExceptionpublic static io.cloudevents.CloudEvent toEvent(io.cloudevents.rw.CloudEventReader reader,
io.cloudevents.rw.CloudEventDataMapper<?> mapper)
throws io.cloudevents.rw.CloudEventRWException
CloudEventReader to a CloudEvent mapping the data with the provided mapper.reader - the reader where to read the message frommapper - the mapper to use when reading the dataio.cloudevents.rw.CloudEventRWException@Nullable
public static <R extends io.cloudevents.CloudEventData> R mapData(io.cloudevents.CloudEvent event,
io.cloudevents.rw.CloudEventDataMapper<R> mapper)
event and map it using the provided mapper.R - the returned CloudEventData implementation from the provided mapperevent - the event eventually containing the datamapper - the mapper to use to map the dataevent and mapped with mapper, if any, otherwise nullCopyright © 2026. All rights reserved.