T
- the type of datapublic class BaseCloudEventMetadata<T> extends Object implements CloudEventMetadata<T>
CloudEventMetadata
interfaceModifier 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()
CloudEventMetadata
getId
in interface CloudEventMetadata<T>
null
public URI getSource()
CloudEventMetadata
getSource
in interface CloudEventMetadata<T>
null
public String getSpecVersion()
CloudEventMetadata
getSpecVersion
in interface CloudEventMetadata<T>
public String getType()
CloudEventMetadata
getType
in interface CloudEventMetadata<T>
public Optional<String> getDataContentType()
CloudEventMetadata
getDataContentType
in interface CloudEventMetadata<T>
public Optional<URI> getDataSchema()
CloudEventMetadata
getDataSchema
in interface CloudEventMetadata<T>
public Optional<String> getSubject()
CloudEventMetadata
getSubject
in interface CloudEventMetadata<T>
public Optional<ZonedDateTime> getTimeStamp()
CloudEventMetadata
getTimeStamp
in interface CloudEventMetadata<T>
public <A> Optional<A> getExtension(String name)
CloudEventMetadata
getExtension
in interface CloudEventMetadata<T>
name
- the name of the attribute, must not be null
public Map<String,Object> getExtensions()
CloudEventMetadata
getExtensions
in interface CloudEventMetadata<T>
public T getData()
CloudEventMetadata
getData
in interface CloudEventMetadata<T>
null
Copyright © 2018–2021 SmallRye. All rights reserved.