public final class CloudEventBuilder extends BaseCloudEventBuilder<CloudEventBuilder,CloudEventV1>
data, extensions| Constructor and Description |
|---|
CloudEventBuilder() |
CloudEventBuilder(CloudEvent event) |
| Modifier and Type | Method and Description |
|---|---|
CloudEvent |
build()
Build the event
|
CloudEventBuilder |
newBuilder()
Copy this builder, creating a new instance with same values.
|
void |
setAttribute(String name,
String value) |
void |
setAttribute(String name,
URI value) |
void |
setAttribute(String name,
ZonedDateTime value) |
protected void |
setAttributes(CloudEvent event) |
CloudEventBuilder |
withDataContentType(String dataContentType)
Set the
datacontenttype of the event |
CloudEventBuilder |
withDataSchema(URI dataSchema)
Set the
dataschema of the event. |
CloudEventBuilder |
withId(String id)
Set the
id of the event |
CloudEventBuilder |
withSource(URI source)
Set the
source of the event |
CloudEventBuilder |
withSubject(String subject)
Set the
subject of the event |
CloudEventBuilder |
withTime(ZonedDateTime time)
Set the
time of the event |
CloudEventBuilder |
withType(String type)
Set the
type of the event |
createMissingAttributeException, end, end, setExtension, setExtension, setExtension, withData, withData, withData, withExtension, withExtension, withExtension, withExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfromSpecVersion, v03, v03, v1, v1public CloudEventBuilder()
public CloudEventBuilder(CloudEvent event)
protected void setAttributes(CloudEvent event)
setAttributes in class BaseCloudEventBuilder<CloudEventBuilder,CloudEventV1>public CloudEventBuilder withId(String id)
CloudEventBuilderid of the eventid - id of the eventpublic CloudEventBuilder withSource(URI source)
CloudEventBuildersource of the eventsource - source of the eventpublic CloudEventBuilder withType(String type)
CloudEventBuildertype of the eventtype - type of the eventpublic CloudEventBuilder withDataSchema(URI dataSchema)
CloudEventBuilderdataschema of the event. For CloudEvent v0.3, this will configure the schemaurl attribute.dataSchema - dataschema of the eventpublic CloudEventBuilder withDataContentType(String dataContentType)
CloudEventBuilderdatacontenttype of the eventdataContentType - datacontenttype of the eventpublic CloudEventBuilder withSubject(String subject)
CloudEventBuildersubject of the eventsubject - subject of the eventpublic CloudEventBuilder withTime(ZonedDateTime time)
CloudEventBuildertime of the eventtime - time of the eventpublic CloudEvent build()
CloudEventBuilderpublic CloudEventBuilder newBuilder()
CloudEventBuilderpublic void setAttribute(String name, String value) throws CloudEventRWException
CloudEventRWExceptionpublic void setAttribute(String name, URI value) throws CloudEventRWException
CloudEventRWExceptionpublic void setAttribute(String name, ZonedDateTime value) throws CloudEventRWException
CloudEventRWExceptionCopyright © 2020. All rights reserved.