@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() |
CloudEvent |
deserialize(byte[] bytes)
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.CloudEvent deserialize(byte[] bytes) throws EventDeserializationException
CloudEvent.bytes - the serialized event.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 © 2020. All rights reserved.