Class SubscriptionBuilder
- All Implemented Interfaces:
Builder<Subscription>
Example to create an instance using the builder pattern
Subscription subscription = Subscription.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.plusChanges(changesBuilder -> changesBuilder)
.destination(destinationBuilder -> destinationBuilder)
.plusMessages(messagesBuilder -> messagesBuilder)
.format(formatBuilder -> formatBuilder)
.status(SubscriptionHealthStatus.HEALTHY)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionChanges subscribed to.Messages subscribed to.build()
builds Subscription with checking for non-null required valuesbuilds Subscription without checking for non-null required valueschanges
(ChangeSubscription... changes) Changes subscribed to.changes
(List<ChangeSubscription> changes) Changes subscribed to.createdAt
(ZonedDateTime createdAt) Date and time (UTC) the Subscription was initially created.IDs and references that created the Subscription.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the Subscription.destination
(Destination destination) Messaging service to which the notifications are sent.destination
(Function<DestinationBuilder, Builder<? extends Destination>> builder) Messaging service to which the notifications are sent.format
(DeliveryFormat format) Format in which the payload is delivered.format
(Function<DeliveryFormatBuilder, Builder<? extends DeliveryFormat>> builder) Format in which the payload is delivered.Changes subscribed to.Date and time (UTC) the Subscription was initially created.IDs and references that created the Subscription.Messaging service to which the notifications are sent.Format in which the payload is delivered.getId()
Unique identifier of the Subscription.getKey()
User-defined unique identifier of the Subscription.Date and time (UTC) the Subscription was last modified.IDs and references that last modified the Subscription.Messages subscribed to.Status of the Subscription.Current version of the Subscription.Unique identifier of the Subscription.User-defined unique identifier of the Subscription.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Subscription was last modified.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the Subscription.IDs and references that last modified the Subscription.messages
(MessageSubscription... messages) Messages subscribed to.messages
(List<MessageSubscription> messages) Messages subscribed to.static SubscriptionBuilder
of()
factory method for an instance of SubscriptionBuilderstatic SubscriptionBuilder
of
(Subscription template) create builder for Subscription instanceplusChanges
(ChangeSubscription... changes) Changes subscribed to.Changes subscribed to.plusMessages
(MessageSubscription... messages) Messages subscribed to.Messages subscribed to.Changes subscribed to.Messages subscribed to.status
(SubscriptionHealthStatus status) Status of the Subscription.Current version of the Subscription.Changes subscribed to.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the Subscription.IDs and references that last modified the Subscription.Messages subscribed to.
-
Constructor Details
-
SubscriptionBuilder
public SubscriptionBuilder()
-
-
Method Details
-
id
Unique identifier of the Subscription.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the Subscription.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Subscription was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Subscription was last modified.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
lastModifiedBy
public SubscriptionBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the Subscription.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
public SubscriptionBuilder withLastModifiedBy(Function<LastModifiedByBuilder, LastModifiedBy> builder) IDs and references that last modified the Subscription.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the Subscription.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the Subscription.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the Subscription.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the Subscription.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
changes
Changes subscribed to.
- Parameters:
changes
- value to be set- Returns:
- Builder
-
changes
Changes subscribed to.
- Parameters:
changes
- value to be set- Returns:
- Builder
-
plusChanges
Changes subscribed to.
- Parameters:
changes
- value to be set- Returns:
- Builder
-
plusChanges
public SubscriptionBuilder plusChanges(Function<ChangeSubscriptionBuilder, ChangeSubscriptionBuilder> builder) Changes subscribed to.
- Parameters:
builder
- function to build the changes value- Returns:
- Builder
-
withChanges
public SubscriptionBuilder withChanges(Function<ChangeSubscriptionBuilder, ChangeSubscriptionBuilder> builder) Changes subscribed to.
- Parameters:
builder
- function to build the changes value- Returns:
- Builder
-
addChanges
public SubscriptionBuilder addChanges(Function<ChangeSubscriptionBuilder, ChangeSubscription> builder) Changes subscribed to.
- Parameters:
builder
- function to build the changes value- Returns:
- Builder
-
setChanges
public SubscriptionBuilder setChanges(Function<ChangeSubscriptionBuilder, ChangeSubscription> builder) Changes subscribed to.
- Parameters:
builder
- function to build the changes value- Returns:
- Builder
-
destination
Messaging service to which the notifications are sent.
- Parameters:
destination
- value to be set- Returns:
- Builder
-
destination
public SubscriptionBuilder destination(Function<DestinationBuilder, Builder<? extends Destination>> builder) Messaging service to which the notifications are sent.
- Parameters:
builder
- function to build the destination value- Returns:
- Builder
-
key
User-defined unique identifier of the Subscription.
- Parameters:
key
- value to be set- Returns:
- Builder
-
messages
Messages subscribed to.
- Parameters:
messages
- value to be set- Returns:
- Builder
-
messages
Messages subscribed to.
- Parameters:
messages
- value to be set- Returns:
- Builder
-
plusMessages
Messages subscribed to.
- Parameters:
messages
- value to be set- Returns:
- Builder
-
plusMessages
public SubscriptionBuilder plusMessages(Function<MessageSubscriptionBuilder, MessageSubscriptionBuilder> builder) Messages subscribed to.
- Parameters:
builder
- function to build the messages value- Returns:
- Builder
-
withMessages
public SubscriptionBuilder withMessages(Function<MessageSubscriptionBuilder, MessageSubscriptionBuilder> builder) Messages subscribed to.
- Parameters:
builder
- function to build the messages value- Returns:
- Builder
-
addMessages
public SubscriptionBuilder addMessages(Function<MessageSubscriptionBuilder, MessageSubscription> builder) Messages subscribed to.
- Parameters:
builder
- function to build the messages value- Returns:
- Builder
-
setMessages
public SubscriptionBuilder setMessages(Function<MessageSubscriptionBuilder, MessageSubscription> builder) Messages subscribed to.
- Parameters:
builder
- function to build the messages value- Returns:
- Builder
-
format
Format in which the payload is delivered.
- Parameters:
format
- value to be set- Returns:
- Builder
-
format
public SubscriptionBuilder format(Function<DeliveryFormatBuilder, Builder<? extends DeliveryFormat>> builder) Format in which the payload is delivered.
- Parameters:
builder
- function to build the format value- Returns:
- Builder
-
status
Status of the Subscription.
- Parameters:
status
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Subscription.
- Returns:
- id
-
getVersion
Current version of the Subscription.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Subscription was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Subscription was last modified.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the Subscription.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Subscription.
- Returns:
- createdBy
-
getChanges
Changes subscribed to.
- Returns:
- changes
-
getDestination
Messaging service to which the notifications are sent.
- Returns:
- destination
-
getKey
User-defined unique identifier of the Subscription.
- Returns:
- key
-
getMessages
Messages subscribed to.
- Returns:
- messages
-
getFormat
Format in which the payload is delivered.
- Returns:
- format
-
getStatus
Status of the Subscription.
- Returns:
- status
-
build
builds Subscription with checking for non-null required values- Specified by:
build
in interfaceBuilder<Subscription>
- Returns:
- Subscription
-
buildUnchecked
builds Subscription without checking for non-null required values- Returns:
- Subscription
-
of
factory method for an instance of SubscriptionBuilder- Returns:
- builder
-
of
create builder for Subscription instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-