public class GenericStructuredMessageReader extends BaseStructuredMessageReader
| Constructor and Description |
|---|
GenericStructuredMessageReader(EventFormat format,
byte[] payload) |
| Modifier and Type | Method and Description |
|---|---|
static GenericStructuredMessageReader |
from(CloudEvent event,
EventFormat format)
Create a generic structured message from a
CloudEvent |
static GenericStructuredMessageReader |
from(CloudEvent event,
String contentType)
Create a generic structured message from a
CloudEvent |
static GenericStructuredMessageReader |
fromContentType(String contentType,
byte[] payload)
Create a generic structured message from a payload
|
<T> T |
read(StructuredMessageWriter<T> writer)
Read the message as structured encoded message using the provided writer
|
getEncoding, readclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitread, read, toEvent, toEventpublic GenericStructuredMessageReader(EventFormat format, byte[] payload)
public <T> T read(StructuredMessageWriter<T> writer) throws CloudEventRWException, IllegalStateException
MessageReaderT - the return type of the StructuredMessageWriterwriter - Structured Message writerStructuredMessageWriter.setEvent(EventFormat, byte[])CloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message is not in structured encoding.public static GenericStructuredMessageReader fromContentType(String contentType, byte[] payload)
contentType - content type to use to resolve the EventFormatpayload - serialized event@Nullable public static GenericStructuredMessageReader from(CloudEvent event, String contentType)
CloudEventevent - contentType - content type to use to resolve the EventFormatpublic static GenericStructuredMessageReader from(CloudEvent event, EventFormat format)
CloudEventevent - format - Copyright © 2023. All rights reserved.