java.lang.Object
io.cloudevents.core.impl.BaseCloudEventBuilder<CloudEventBuilder,CloudEventV1>
io.cloudevents.core.v1.CloudEventBuilder
- All Implemented Interfaces:
CloudEventBuilder,io.cloudevents.rw.CloudEventContextWriter,io.cloudevents.rw.CloudEventWriter<io.cloudevents.CloudEvent>
CloudEvent V1.0 builder.
- Author:
- fabiojose, slinkydeveloper
-
Field Summary
Fields inherited from class io.cloudevents.core.impl.BaseCloudEventBuilder
data, extensions -
Constructor Summary
ConstructorsConstructorDescriptionCloudEventBuilder(io.cloudevents.CloudEvent event) CloudEventBuilder(io.cloudevents.CloudEventContext context) -
Method Summary
Modifier and TypeMethodDescriptionio.cloudevents.CloudEventbuild()Build the eventCopy this builder, creating a new instance with same values.protected voidsetAttributes(io.cloudevents.CloudEventContext event) io.cloudevents.rw.CloudEventContextWriterwithContextAttribute(String name, byte[] value) io.cloudevents.rw.CloudEventContextWriterwithContextAttribute(String name, Boolean value) io.cloudevents.rw.CloudEventContextWriterwithContextAttribute(String name, Integer value) io.cloudevents.rw.CloudEventContextWriterwithContextAttribute(String name, Number value) io.cloudevents.rw.CloudEventContextWriterwithContextAttribute(String name, String value) io.cloudevents.rw.CloudEventContextWriterwithContextAttribute(String name, URI value) io.cloudevents.rw.CloudEventContextWriterwithContextAttribute(String name, OffsetDateTime value) withDataContentType(String dataContentType) Set thedatacontenttypeof the eventwithDataSchema(URI dataSchema) Set thedataschemaof the event.Set theidof the eventwithSource(URI source) Set thesourceof the eventwithSubject(String subject) Set thesubjectof the eventwithTime(OffsetDateTime time) Set thetimeof the eventSet thetypeof the eventMethods inherited from class io.cloudevents.core.impl.BaseCloudEventBuilder
createEmptyAttributeException, createMissingAttributeException, end, end, requireValidAttributeWrite, withData, withData, withData, withData, withData, withData, withExtension, withExtension, withExtension, withExtension, withExtension, withExtension, withExtension, withExtension, withoutData, withoutDataContentType, withoutDataSchema, withoutExtension, withoutExtension
-
Constructor Details
-
CloudEventBuilder
public CloudEventBuilder() -
CloudEventBuilder
public CloudEventBuilder(io.cloudevents.CloudEvent event) -
CloudEventBuilder
public CloudEventBuilder(io.cloudevents.CloudEventContext context)
-
-
Method Details
-
setAttributes
protected void setAttributes(io.cloudevents.CloudEventContext event) - Specified by:
setAttributesin classBaseCloudEventBuilder<CloudEventBuilder,CloudEventV1>
-
withId
Description copied from interface:CloudEventBuilderSet theidof the event- Parameters:
id- id of the event- Returns:
- self
-
withSource
Description copied from interface:CloudEventBuilderSet thesourceof the event- Parameters:
source- source of the event- Returns:
- self
-
withType
Description copied from interface:CloudEventBuilderSet thetypeof the event- Parameters:
type- type of the event- Returns:
- self
-
withDataSchema
Description copied from interface:CloudEventBuilderSet thedataschemaof the event. For CloudEvent v0.3, this will configure theschemaurlattribute.- Parameters:
dataSchema- dataschema of the event- Returns:
- self
-
withDataContentType
Description copied from interface:CloudEventBuilderSet thedatacontenttypeof the event- Parameters:
dataContentType- datacontenttype of the event- Returns:
- self
-
withSubject
Description copied from interface:CloudEventBuilderSet thesubjectof the event- Parameters:
subject- subject of the event- Returns:
- self
-
withTime
Description copied from interface:CloudEventBuilderSet thetimeof the event- Parameters:
time- time of the event- Returns:
- self
-
build
public io.cloudevents.CloudEvent build()Description copied from interface:CloudEventBuilderBuild the event- Returns:
- the built event
-
newBuilder
Description copied from interface:CloudEventBuilderCopy this builder, creating a new instance with same values.- Returns:
- A new builder with same values of this instance
-
withContextAttribute
public io.cloudevents.rw.CloudEventContextWriter withContextAttribute(String name, String value) throws io.cloudevents.rw.CloudEventRWException - Throws:
io.cloudevents.rw.CloudEventRWException
-
withContextAttribute
public io.cloudevents.rw.CloudEventContextWriter withContextAttribute(String name, URI value) throws io.cloudevents.rw.CloudEventRWException - Throws:
io.cloudevents.rw.CloudEventRWException
-
withContextAttribute
public io.cloudevents.rw.CloudEventContextWriter withContextAttribute(String name, OffsetDateTime value) throws io.cloudevents.rw.CloudEventRWException - Throws:
io.cloudevents.rw.CloudEventRWException
-
withContextAttribute
public io.cloudevents.rw.CloudEventContextWriter withContextAttribute(String name, Number value) throws io.cloudevents.rw.CloudEventRWException - Throws:
io.cloudevents.rw.CloudEventRWException
-
withContextAttribute
public io.cloudevents.rw.CloudEventContextWriter withContextAttribute(String name, Integer value) throws io.cloudevents.rw.CloudEventRWException - Throws:
io.cloudevents.rw.CloudEventRWException
-
withContextAttribute
public io.cloudevents.rw.CloudEventContextWriter withContextAttribute(String name, Boolean value) throws io.cloudevents.rw.CloudEventRWException - Throws:
io.cloudevents.rw.CloudEventRWException
-
withContextAttribute
public io.cloudevents.rw.CloudEventContextWriter withContextAttribute(String name, byte[] value) throws io.cloudevents.rw.CloudEventRWException - Throws:
io.cloudevents.rw.CloudEventRWException
-