@FunctionalInterface @ParametersAreNonnullByDefault public interface StructuredMessageReader
| Modifier and Type | Method and Description |
|---|---|
static StructuredMessageReader |
from(CloudEvent event,
EventFormat format)
Create a generic structured message from a
CloudEvent |
static StructuredMessageReader |
from(CloudEvent event,
String contentType)
Create a generic structured message from a
CloudEvent |
<T> T |
read(StructuredMessageWriter<T> visitor) |
default CloudEvent |
toEvent() |
<T> T read(StructuredMessageWriter<T> visitor) throws CloudEventRWException, IllegalStateException
visitor - CloudEventRWException - If something went wrong whenIllegalStateException - If the message is not a valid structured messagedefault CloudEvent toEvent() throws CloudEventRWException, IllegalStateException
static StructuredMessageReader from(CloudEvent event, String contentType)
CloudEventevent - contentType - content type to use to resolve the EventFormatstatic StructuredMessageReader from(CloudEvent event, EventFormat format)
CloudEventevent - format - Copyright © 2020. All rights reserved.