Class MessageDeliveryPayloadBuilder
- All Implemented Interfaces:
Builder<MessageDeliveryPayload>
- Direct Known Subclasses:
MessageDeliveryBuilder
Example to create an instance using the builder pattern
MessageDeliveryPayload messageDeliveryPayload = MessageDeliveryPayload.builder()
.projectKey("{projectKey}")
.resource(resourceBuilder -> resourceBuilder)
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.sequenceNumber(0.3)
.resourceVersion(0.3)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds MessageDeliveryPayload with checking for non-null required valuesbuilds MessageDeliveryPayload without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the resource was initially created.Date and time (UTC) the resource was initially created.getId()
Unique ID of the message.Date and time (UTC) the resource was last modified.If the payload does not fit into the size limit or its format is not accepted by the messaging service, thepayloadNotIncluded
field is present.key
of the Project.Reference to the resource that triggered the notification.User-defined unique identifiers of the resource.Version of the resource on which the update was performed.Used to ensure all messages of the resource are processed in correct order.Last seen version of the resource.Unique ID of the message.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the resource was last modified.of()
factory method for an instance of MessageDeliveryPayloadBuilderof
(MessageDeliveryPayload template) create builder for MessageDeliveryPayload instancepayloadNotIncluded
(PayloadNotIncluded payloadNotIncluded) If the payload does not fit into the size limit or its format is not accepted by the messaging service, thepayloadNotIncluded
field is present.If the payload does not fit into the size limit or its format is not accepted by the messaging service, thepayloadNotIncluded
field is present.projectKey
(String projectKey) key
of the Project.Reference to the resource that triggered the notification.resource
(Function<ReferenceBuilder, Builder<? extends Reference>> builder) Reference to the resource that triggered the notification.resourceUserProvidedIdentifiers
(UserProvidedIdentifiers resourceUserProvidedIdentifiers) User-defined unique identifiers of the resource.resourceUserProvidedIdentifiers
(Function<UserProvidedIdentifiersBuilder, UserProvidedIdentifiersBuilder> builder) User-defined unique identifiers of the resource.resourceVersion
(Long resourceVersion) Version of the resource on which the update was performed.sequenceNumber
(Long sequenceNumber) Used to ensure all messages of the resource are processed in correct order.Last seen version of the resource.If the payload does not fit into the size limit or its format is not accepted by the messaging service, thepayloadNotIncluded
field is present.withResourceUserProvidedIdentifiers
(Function<UserProvidedIdentifiersBuilder, UserProvidedIdentifiers> builder) User-defined unique identifiers of the resource.
-
Constructor Details
-
MessageDeliveryPayloadBuilder
public MessageDeliveryPayloadBuilder()
-
-
Method Details
-
projectKey
key
of the Project. Useful for processing notifications if the Destination receives them from multiple Projects.- Parameters:
projectKey
- value to be set- Returns:
- Builder
-
resource
Reference to the resource that triggered the notification.
- Parameters:
resource
- value to be set- Returns:
- Builder
-
resource
public MessageDeliveryPayloadBuilder resource(Function<ReferenceBuilder, Builder<? extends Reference>> builder) Reference to the resource that triggered the notification.
- Parameters:
builder
- function to build the resource value- Returns:
- Builder
-
resourceUserProvidedIdentifiers
public MessageDeliveryPayloadBuilder resourceUserProvidedIdentifiers(Function<UserProvidedIdentifiersBuilder, UserProvidedIdentifiersBuilder> builder) User-defined unique identifiers of the resource.
- Parameters:
builder
- function to build the resourceUserProvidedIdentifiers value- Returns:
- Builder
-
withResourceUserProvidedIdentifiers
public MessageDeliveryPayloadBuilder withResourceUserProvidedIdentifiers(Function<UserProvidedIdentifiersBuilder, UserProvidedIdentifiers> builder) User-defined unique identifiers of the resource.
- Parameters:
builder
- function to build the resourceUserProvidedIdentifiers value- Returns:
- Builder
-
resourceUserProvidedIdentifiers
public MessageDeliveryPayloadBuilder resourceUserProvidedIdentifiers(@Nullable UserProvidedIdentifiers resourceUserProvidedIdentifiers) User-defined unique identifiers of the resource.
- Parameters:
resourceUserProvidedIdentifiers
- value to be set- Returns:
- Builder
-
id
Unique ID of the message.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Last seen version of the resource.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the resource was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the resource was last modified.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
sequenceNumber
Used to ensure all messages of the resource are processed in correct order. The
sequenceNumber
of the next message of the resource is a successor of thesequenceNumber
of the current message.- Parameters:
sequenceNumber
- value to be set- Returns:
- Builder
-
resourceVersion
Version of the resource on which the update was performed.
- Parameters:
resourceVersion
- value to be set- Returns:
- Builder
-
payloadNotIncluded
public MessageDeliveryPayloadBuilder payloadNotIncluded(Function<PayloadNotIncludedBuilder, PayloadNotIncludedBuilder> builder) If the payload does not fit into the size limit or its format is not accepted by the messaging service, the
payloadNotIncluded
field is present.- Parameters:
builder
- function to build the payloadNotIncluded value- Returns:
- Builder
-
withPayloadNotIncluded
public MessageDeliveryPayloadBuilder withPayloadNotIncluded(Function<PayloadNotIncludedBuilder, PayloadNotIncluded> builder) If the payload does not fit into the size limit or its format is not accepted by the messaging service, the
payloadNotIncluded
field is present.- Parameters:
builder
- function to build the payloadNotIncluded value- Returns:
- Builder
-
payloadNotIncluded
public MessageDeliveryPayloadBuilder payloadNotIncluded(@Nullable PayloadNotIncluded payloadNotIncluded) If the payload does not fit into the size limit or its format is not accepted by the messaging service, the
payloadNotIncluded
field is present.- Parameters:
payloadNotIncluded
- value to be set- Returns:
- Builder
-
getProjectKey
key
of the Project. Useful for processing notifications if the Destination receives them from multiple Projects.- Returns:
- projectKey
-
getResource
Reference to the resource that triggered the notification.
- Returns:
- resource
-
getResourceUserProvidedIdentifiers
User-defined unique identifiers of the resource.
- Returns:
- resourceUserProvidedIdentifiers
-
getId
Unique ID of the message.
- Returns:
- id
-
getVersion
Last seen version of the resource.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the resource was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the resource was last modified.
- Returns:
- lastModifiedAt
-
getSequenceNumber
Used to ensure all messages of the resource are processed in correct order. The
sequenceNumber
of the next message of the resource is a successor of thesequenceNumber
of the current message.- Returns:
- sequenceNumber
-
getResourceVersion
Version of the resource on which the update was performed.
- Returns:
- resourceVersion
-
getPayloadNotIncluded
If the payload does not fit into the size limit or its format is not accepted by the messaging service, the
payloadNotIncluded
field is present.- Returns:
- payloadNotIncluded
-
build
builds MessageDeliveryPayload with checking for non-null required values- Specified by:
build
in interfaceBuilder<MessageDeliveryPayload>
- Returns:
- MessageDeliveryPayload
-
buildUnchecked
builds MessageDeliveryPayload without checking for non-null required values- Returns:
- MessageDeliveryPayload
-
of
factory method for an instance of MessageDeliveryPayloadBuilder- Returns:
- builder
-
of
create builder for MessageDeliveryPayload instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-