@ParametersAreNonnullByDefault public interface EventFormat
An implementation of this interface should support all specification versions of CloudEvent.
Implementations of this interface can be registered to the EventFormatProvider to use them.
EventFormatProvider| Modifier and Type | Method and Description |
|---|---|
default Set<String> |
deserializableContentTypes() |
default io.cloudevents.CloudEvent |
deserialize(byte[] bytes)
Like
deserialize(byte[], CloudEventDataMapper), but with the identity CloudEventDataMapper. |
io.cloudevents.CloudEvent |
deserialize(byte[] bytes,
io.cloudevents.rw.CloudEventDataMapper<? extends io.cloudevents.CloudEventData> mapper)
Deserialize a byte array to a
CloudEvent. |
byte[] |
serialize(io.cloudevents.CloudEvent event)
Serialize a
CloudEvent to a byte array. |
String |
serializedContentType() |
byte[] serialize(io.cloudevents.CloudEvent event)
throws EventSerializationException
CloudEvent to a byte array.event - the event to serialize.EventSerializationException - if something goes wrong during serialization.default io.cloudevents.CloudEvent deserialize(byte[] bytes)
throws EventDeserializationException
deserialize(byte[], CloudEventDataMapper), but with the identity CloudEventDataMapper.EventDeserializationExceptiondeserialize(byte[], CloudEventDataMapper)io.cloudevents.CloudEvent deserialize(byte[] bytes,
io.cloudevents.rw.CloudEventDataMapper<? extends io.cloudevents.CloudEventData> mapper)
throws EventDeserializationException
CloudEvent.bytes - the serialized event.mapper - the mapper to use to map the data.EventDeserializationException - if something goes wrong during deserialization.default Set<String> deserializableContentTypes()
EventFormatProvider to resolve an EventFormat starting
from the content type String.String serializedContentType()
EventFormat.Copyright © 2026. All rights reserved.