@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 CloudEvent |
deserialize(byte[] bytes)
Like
deserialize(byte[], CloudEventDataMapper), but with the identity CloudEventDataMapper. |
CloudEvent |
deserialize(byte[] bytes,
CloudEventDataMapper<? extends CloudEventData> mapper)
Deserialize a byte array to a
CloudEvent. |
byte[] |
serialize(CloudEvent event)
Serialize a
CloudEvent to a byte array. |
String |
serializedContentType() |
byte[] serialize(CloudEvent event) throws EventSerializationException
CloudEvent to a byte array.event - the event to serialize.EventSerializationException - if something goes wrong during serialization.default CloudEvent deserialize(byte[] bytes) throws EventDeserializationException
deserialize(byte[], CloudEventDataMapper), but with the identity CloudEventDataMapper.EventDeserializationExceptiondeserialize(byte[], CloudEventDataMapper)CloudEvent deserialize(byte[] bytes, CloudEventDataMapper<? extends 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 © 2024. All rights reserved.