Improve CloudEventHeaderUtils with narrower scoped method (#318)

Signed-off-by: Dave Syer <dsyer@vmware.com>
This commit is contained in:
Dave Syer 2020-12-10 09:25:21 +00:00 committed by GitHub
parent f5d9b47c1c
commit 24d108fe5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -51,13 +51,13 @@ public class CloudEventHeaderUtils {
}
/**
* Helper method for extracting {@link MessageHeaders} from a {@link CloudEvent}. The
* result will contain headers canonicalized with a "ce-" prefix, analogous to the
* "binary" message format in Cloud Events.
* @param event the input {@link CloudEvent}
* Helper method for extracting {@link MessageHeaders} from a
* {@link CloudEventContext}. The result will contain headers canonicalized with a
* "ce-" prefix, analogous to the "binary" message format in Cloud Events.
* @param event the input {@link CloudEventContext}
* @return the response headers represented by the event
*/
public static Map<String, Object> toMap(CloudEvent event) {
public static Map<String, Object> toMap(CloudEventContext event) {
Map<String, Object> headers = new HashMap<>();
// Probably this should be done in CloudEventContextReaderAdapter
headers.put(CE_PREFIX + "specversion", event.getSpecVersion().toString());