T - the type of datapublic class BaseCloudEventMetadata<T> extends Object implements CloudEventMetadata<T>
CloudEventMetadata interface| Modifier and Type | Field and Description |
|---|---|
protected T |
data |
protected String |
dataContentType |
protected URI |
dataSchema |
protected Map<String,Object> |
extensions |
protected String |
id |
protected URI |
source |
protected String |
specVersion |
protected String |
subject |
protected ZonedDateTime |
timestamp |
protected String |
type |
CE_ATTRIBUTE_DATA_CONTENT_TYPE, CE_ATTRIBUTE_DATA_SCHEMA, CE_ATTRIBUTE_ID, CE_ATTRIBUTE_SOURCE, CE_ATTRIBUTE_SPEC_VERSION, CE_ATTRIBUTE_SUBJECT, CE_ATTRIBUTE_TIME, CE_ATTRIBUTE_TYPE, CE_VERSION_1_0| Constructor and Description |
|---|
BaseCloudEventMetadata(String specVersion,
String id,
URI source,
String type,
String dataContentType,
URI dataSchema,
String subject,
ZonedDateTime timestamp,
Map<String,Object> extensions,
T data) |
| Modifier and Type | Method and Description |
|---|---|
T |
getData()
The event payload.
|
Optional<String> |
getDataContentType()
Content type of data value.
|
Optional<URI> |
getDataSchema()
Identifies the schema that data adheres to.
|
<A> Optional<A> |
getExtension(String name)
A CloudEvent may include any number of additional context attributes with distinct names, known as "extension
attributes".
|
Map<String,Object> |
getExtensions()
A CloudEvent may include any number of additional context attributes with distinct names, known as "extension
attributes".
|
String |
getId()
Identifies the event.
|
URI |
getSource()
Identifies the context in which an event happened.
|
String |
getSpecVersion()
The version of the CloudEvents specification which the event uses.
|
Optional<String> |
getSubject()
This describes the subject of the event in the context of the event producer (identified by source).
|
Optional<ZonedDateTime> |
getTimeStamp()
Timestamp of when the occurrence happened.
|
String |
getType()
This attribute contains a value describing the type of event related to the originating occurrence.
|
void |
validate() |
protected final String id
protected final String specVersion
protected final URI source
protected final String type
protected final String dataContentType
protected final URI dataSchema
protected final String subject
protected final ZonedDateTime timestamp
protected final T data
public void validate()
public String getId()
CloudEventMetadatagetId in interface CloudEventMetadata<T>nullpublic URI getSource()
CloudEventMetadatagetSource in interface CloudEventMetadata<T>nullpublic String getSpecVersion()
CloudEventMetadatagetSpecVersion in interface CloudEventMetadata<T>public String getType()
CloudEventMetadatagetType in interface CloudEventMetadata<T>public Optional<String> getDataContentType()
CloudEventMetadatagetDataContentType in interface CloudEventMetadata<T>public Optional<URI> getDataSchema()
CloudEventMetadatagetDataSchema in interface CloudEventMetadata<T>public Optional<String> getSubject()
CloudEventMetadatagetSubject in interface CloudEventMetadata<T>public Optional<ZonedDateTime> getTimeStamp()
CloudEventMetadatagetTimeStamp in interface CloudEventMetadata<T>public <A> Optional<A> getExtension(String name)
CloudEventMetadatagetExtension in interface CloudEventMetadata<T>name - the name of the attribute, must not be nullpublic Map<String,Object> getExtensions()
CloudEventMetadatagetExtensions in interface CloudEventMetadata<T>public T getData()
CloudEventMetadatagetData in interface CloudEventMetadata<T>nullCopyright © 2018–2021 SmallRye. All rights reserved.