Class CloudEventsPayloadBuilder
- All Implemented Interfaces:
Builder<CloudEventsPayload>
Example to create an instance using the builder pattern
CloudEventsPayload cloudEventsPayload = CloudEventsPayload.builder()
.specversion("{specversion}")
.id("{id}")
.type("{type}")
.source("{source}")
.subject("{subject}")
.time(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.data(dataBuilder -> dataBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds CloudEventsPayload with checking for non-null required valuesbuilds CloudEventsPayload without checking for non-null required valuesdata(DeliveryPayload data) The URI from which the message can be retrieved if messages are enabled.getData()The URI from which the message can be retrieved if messages are enabled.getId()Unique identifier of the event.Corresponds to thesequenceNumberof a MessageSubscription."Integer"The default REST URI of the ReferenceTypeId that triggered this event, including the project key.The version of the CloudEvents specification which the event uses.Unique identifier of the resource that triggered the event.getTime()Corresponds to thelastModifiedAtof the resource at the time the event was triggered.getType()Thetypeis namespaced withcom.commercetools, followed by the ReferenceTypeId, the type of Subscription (eithermessageorchange), and the message or change type.Unique identifier of the event.static CloudEventsPayloadBuilderof()factory method for an instance of CloudEventsPayloadBuilderstatic CloudEventsPayloadBuilderof(CloudEventsPayload template) create builder for CloudEventsPayload instanceCorresponds to thesequenceNumberof a MessageSubscription.sequencetype(String sequencetype) "Integer"The default REST URI of the ReferenceTypeId that triggered this event, including the project key.specversion(String specversion) The version of the CloudEvents specification which the event uses.Unique identifier of the resource that triggered the event.time(ZonedDateTime time) Corresponds to thelastModifiedAtof the resource at the time the event was triggered.Thetypeis namespaced withcom.commercetools, followed by the ReferenceTypeId, the type of Subscription (eithermessageorchange), and the message or change type.
-
Constructor Details
-
CloudEventsPayloadBuilder
public CloudEventsPayloadBuilder()
-
-
Method Details
-
specversion
The version of the CloudEvents specification which the event uses.
- Parameters:
specversion- value to be set- Returns:
- Builder
-
id
Unique identifier of the event.
- Parameters:
id- value to be set- Returns:
- Builder
-
type
The
typeis namespaced withcom.commercetools, followed by the ReferenceTypeId, the type of Subscription (eithermessageorchange), and the message or change type. For example,com.commercetools.product.message.ProductPublishedorcom.commercetools.order.change.ResourceCreated.- Parameters:
type- value to be set- Returns:
- Builder
-
source
The default REST URI of the ReferenceTypeId that triggered this event, including the project key.
- Parameters:
source- value to be set- Returns:
- Builder
-
subject
Unique identifier of the resource that triggered the event.
- Parameters:
subject- value to be set- Returns:
- Builder
-
time
Corresponds to the
lastModifiedAtof the resource at the time the event was triggered.- Parameters:
time- value to be set- Returns:
- Builder
-
sequence
Corresponds to the
sequenceNumberof a MessageSubscription. Can be used to process messages in the correct order.- Parameters:
sequence- value to be set- Returns:
- Builder
-
sequencetype
"Integer"- Parameters:
sequencetype- value to be set- Returns:
- Builder
-
dataref
The URI from which the message can be retrieved if messages are enabled. Only set for MessageSubscriptions.
- Parameters:
dataref- value to be set- Returns:
- Builder
-
data
MessageDeliveryPayload, ResourceCreatedDeliveryPayload, ResourceUpdatedDeliveryPayload, or ResourceDeletedDeliveryPayload, EventDeliveryPayload.
- Parameters:
data- value to be set- Returns:
- Builder
-
getSpecversion
The version of the CloudEvents specification which the event uses.
- Returns:
- specversion
-
getId
Unique identifier of the event.
- Returns:
- id
-
getType
The
typeis namespaced withcom.commercetools, followed by the ReferenceTypeId, the type of Subscription (eithermessageorchange), and the message or change type. For example,com.commercetools.product.message.ProductPublishedorcom.commercetools.order.change.ResourceCreated.- Returns:
- type
-
getSource
The default REST URI of the ReferenceTypeId that triggered this event, including the project key.
- Returns:
- source
-
getSubject
Unique identifier of the resource that triggered the event.
- Returns:
- subject
-
getTime
Corresponds to the
lastModifiedAtof the resource at the time the event was triggered.- Returns:
- time
-
getSequence
Corresponds to the
sequenceNumberof a MessageSubscription. Can be used to process messages in the correct order.- Returns:
- sequence
-
getSequencetype
"Integer"- Returns:
- sequencetype
-
getDataref
The URI from which the message can be retrieved if messages are enabled. Only set for MessageSubscriptions.
- Returns:
- dataref
-
getData
MessageDeliveryPayload, ResourceCreatedDeliveryPayload, ResourceUpdatedDeliveryPayload, or ResourceDeletedDeliveryPayload, EventDeliveryPayload.
- Returns:
- data
-
build
builds CloudEventsPayload with checking for non-null required values- Specified by:
buildin interfaceBuilder<CloudEventsPayload>- Returns:
- CloudEventsPayload
-
buildUnchecked
builds CloudEventsPayload without checking for non-null required values- Returns:
- CloudEventsPayload
-
of
factory method for an instance of CloudEventsPayloadBuilder- Returns:
- builder
-
of
create builder for CloudEventsPayload instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-