public class CloudEventContextUtils extends Object
CloudEventContext.| Constructor and Description |
|---|
CloudEventContextUtils() |
| Modifier and Type | Method and Description |
|---|---|
static io.cloudevents.CloudEventContext |
fromMap(Map<String,Object> headers)
Helper method for converting
MessageHeaders to a CloudEventContext. |
static Map<String,Object> |
toMap(io.cloudevents.CloudEventContext context)
Helper method for extracting
MessageHeaders from a CloudEventContext. |
public static io.cloudevents.CloudEventContext fromMap(Map<String,Object> headers) throws io.cloudevents.rw.CloudEventRWException
MessageHeaders to a CloudEventContext.
The input headers must represent a valid event in "binary" form, i.e. it must have headers
ce-id, ce-specversion etc.headers - the input message headersCloudEventContext that can be used to create a new CloudEventio.cloudevents.rw.CloudEventRWException - if something goes wrong while converting the headers to CloudEventContextpublic static Map<String,Object> toMap(io.cloudevents.CloudEventContext context) throws io.cloudevents.rw.CloudEventRWException
MessageHeaders from a CloudEventContext. The
result will contain headers canonicalized with a ce- prefix, analogous to the
"binary" message format in Cloud Events.context - the input CloudEventContextio.cloudevents.rw.CloudEventRWException - if something goes wrong while converting the CloudEventContext to headersCopyright © 2023. All rights reserved.