Interface Subscription

All Superinterfaces:
BaseResource, DomainResource<Subscription>, Identifiable<Subscription>, Versioned<Subscription>, WithKey

public interface Subscription extends BaseResource, DomainResource<Subscription>, WithKey
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()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Subscription.

      Specified by:
      getId in interface BaseResource
      Specified by:
      getId in interface DomainResource<Subscription>
      Specified by:
      getId in interface Identifiable<Subscription>
      Specified by:
      getId in interface Versioned<Subscription>
      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Current version of the Subscription.

      Specified by:
      getVersion in interface BaseResource
      Specified by:
      getVersion in interface DomainResource<Subscription>
      Specified by:
      getVersion in interface Versioned<Subscription>
      Returns:
      version
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the Subscription was initially created.

      Specified by:
      getCreatedAt in interface BaseResource
      Returns:
      createdAt
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Subscription was last modified.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Valid @Valid LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the Subscription.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Valid @Valid CreatedBy getCreatedBy()

      IDs and references that created the Subscription.

      Returns:
      createdBy
    • getChanges

      @NotNull @Valid @NotNull @Valid List<ChangeSubscription> getChanges()

      Changes subscribed to.

      Returns:
      changes
    • getDestination

      @NotNull @Valid @NotNull @Valid Destination getDestination()

      Messaging service to which the notifications are sent.

      Returns:
      destination
    • getKey

      String getKey()

      User-defined unique identifier of the Subscription.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getMessages

      @NotNull @Valid @NotNull @Valid List<MessageSubscription> getMessages()

      Messages subscribed to.

      Returns:
      messages
    • getFormat

      @NotNull @Valid @NotNull @Valid DeliveryFormat getFormat()

      Format in which the payload is delivered.

      Returns:
      format
    • getStatus

      @NotNull @NotNull SubscriptionHealthStatus getStatus()

      Status of the Subscription.

      Returns:
      status
    • setId

      void setId(String id)

      Unique identifier of the Subscription.

      Specified by:
      setId in interface BaseResource
      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Current version of the Subscription.

      Specified by:
      setVersion in interface BaseResource
      Parameters:
      version - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the Subscription was initially created.

      Specified by:
      setCreatedAt in interface BaseResource
      Parameters:
      createdAt - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Subscription was last modified.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Parameters:
      lastModifiedAt - value to be set
    • setLastModifiedBy

      void setLastModifiedBy(LastModifiedBy lastModifiedBy)

      IDs and references that last modified the Subscription.

      Parameters:
      lastModifiedBy - value to be set
    • setCreatedBy

      void setCreatedBy(CreatedBy createdBy)

      IDs and references that created the Subscription.

      Parameters:
      createdBy - value to be set
    • setChanges

      void setChanges(ChangeSubscription... changes)

      Changes subscribed to.

      Parameters:
      changes - values to be set
    • setChanges

      void setChanges(List<ChangeSubscription> changes)

      Changes subscribed to.

      Parameters:
      changes - values to be set
    • setDestination

      void setDestination(Destination destination)

      Messaging service to which the notifications are sent.

      Parameters:
      destination - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the Subscription.

      Parameters:
      key - value to be set
    • setMessages

      void setMessages(MessageSubscription... messages)

      Messages subscribed to.

      Parameters:
      messages - values to be set
    • setMessages

      void setMessages(List<MessageSubscription> messages)

      Messages subscribed to.

      Parameters:
      messages - values to be set
    • setFormat

      void setFormat(DeliveryFormat format)

      Format in which the payload is delivered.

      Parameters:
      format - value to be set
    • setStatus

      void setStatus(SubscriptionHealthStatus status)

      Status of the Subscription.

      Parameters:
      status - value to be set
    • of

      static Subscription of()
      factory method
      Returns:
      instance of Subscription
    • of

      static Subscription of(Subscription template)
      factory method to create a shallow copy Subscription
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static Subscription deepCopy(@Nullable Subscription template)
      factory method to create a deep copy of Subscription
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static SubscriptionBuilder builder()
      builder factory method for Subscription
      Returns:
      builder
    • builder

      static SubscriptionBuilder builder(Subscription template)
      create builder for Subscription instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withSubscription

      default <T> T withSubscription(Function<Subscription,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<Subscription> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference