public class CloudEventBuilder<T> extends Object implements EventBuilder<T,AttributesImpl>, Builder<AttributesImpl,T>
public static <T> CloudEventBuilder<T> builder()
T - The 'data' typepublic static <T> CloudEventBuilder<T> builder(CloudEvent<AttributesImpl,T> base)
T - The 'data' typebase - A base event to copy CloudEvent.getAttributes(),
CloudEvent.getData() and CloudEvent.getExtensions()public static <T> CloudEventImpl<T> of(T data, AttributesImpl attributes, Collection<ExtensionFormat> extensions)
T - the type of 'data'data - the value of dataattributes - the context attributesCloudEventImpl immutable instanceIllegalStateException - When there are specification constraints
violationspublic CloudEvent<AttributesImpl,T> build(T data, AttributesImpl attributes, Collection<ExtensionFormat> extensions)
EventBuilderbuild in interface EventBuilder<T,AttributesImpl>public CloudEventImpl<T> build()
CloudEventbuild in interface Builder<AttributesImpl,T>CloudEventImpl immutable instanceIllegalStateException - When there are specification constraints
violationspublic CloudEventBuilder<T> withType(String type)
public CloudEventBuilder<T> withId(String id)
public CloudEventBuilder<T> withSource(URI source)
public CloudEventBuilder<T> withTime(ZonedDateTime time)
public CloudEventBuilder<T> withSchemaurl(URI schemaurl)
public CloudEventBuilder<T> withContenttype(String contenttype)
public CloudEventBuilder<T> withData(T data)
public CloudEventBuilder<T> withExtension(ExtensionFormat extension)
public <TT> CloudEvent<AttributesImpl,TT> build(CloudEvent<AttributesImpl,T> base, String id, TT newData)
CloudEvent with another
type of 'data'build in interface Builder<AttributesImpl,T>TT - The new type of 'data'base - The base CloudEvent to copy its attributesid - The new id for the new instancenewData - The new 'data'Copyright © 2019. All rights reserved.