HK - Header key typeHV - Header value typepublic abstract class BaseGenericBinaryMessageReaderImpl<HK,HV> extends BaseBinaryMessageReader
MessageReader,
providing common logic to most protocol bindings which supports both Binary and Structured mode.
Content-type is handled separately using a key not prefixed with CloudEvents header prefix.
| Modifier | Constructor and Description |
|---|---|
protected |
BaseGenericBinaryMessageReaderImpl(SpecVersion version,
CloudEventData body) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
forEachHeader(BiConsumer<HK,HV> fn)
Iterate over all the headers in the headers map.
|
protected abstract boolean |
isCloudEventsHeader(HK key) |
protected abstract boolean |
isContentTypeHeader(HK key) |
<T extends CloudEventWriter<V>,V> |
read(CloudEventWriterFactory<T,V> writerFactory,
CloudEventDataMapper<? extends CloudEventData> mapper)
Read the message as binary encoded message using the provided writer factory.
|
protected abstract String |
toCloudEventsKey(HK key) |
protected abstract String |
toCloudEventsValue(HV value) |
getEncoding, readclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitread, read, toEvent, toEventfrom, fromprotected BaseGenericBinaryMessageReaderImpl(SpecVersion version, CloudEventData body)
public <T extends CloudEventWriter<V>,V> V read(CloudEventWriterFactory<T,V> writerFactory, CloudEventDataMapper<? extends CloudEventData> mapper) throws CloudEventRWException, IllegalStateException
MessageReaderT - the CloudEventWriter typeV - the return type of the CloudEventWriterwriterFactory - a factory that generates a reader starting from the SpecVersion of the eventmapper - the mapper to use to map the data, if any.CloudEventRWException - if something went wrong during the visit.IllegalStateException - if the message is not in binary encoding.protected abstract boolean isContentTypeHeader(HK key)
key - header keyprotected abstract boolean isCloudEventsHeader(HK key)
key - header keyprotected abstract String toCloudEventsKey(HK key)
key - header keyprotected abstract void forEachHeader(BiConsumer<HK,HV> fn)
fn - header consumerCopyright © 2023. All rights reserved.