Interface SubscriptionDraft

All Superinterfaces:
Draft<SubscriptionDraft>, WithKey

public interface SubscriptionDraft extends WithKey, Draft<SubscriptionDraft>

Either messages or changes must be set.


Example to create an instance using the builder pattern

     SubscriptionDraft subscriptionDraft = SubscriptionDraft.builder()
             .destination(destinationBuilder -> destinationBuilder)
             .build()
 
  • Method Details

    • getChanges

      @Valid @Valid List<ChangeSubscription> getChanges()

      Change notifications to be subscribed to.

      Returns:
      changes
    • getDestination

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

      Messaging service to which the messages are sent.

      Returns:
      destination
    • getKey

      String getKey()

      User-defined unique identifier for the Subscription.

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

      @Valid @Valid List<MessageSubscription> getMessages()

      Messages to be subscribed to.

      Returns:
      messages
    • getFormat

      @Valid @Valid DeliveryFormat getFormat()

      Format in which the payload is delivered. When not provided, the PlatformFormat is selected by default.

      Returns:
      format
    • setChanges

      void setChanges(ChangeSubscription... changes)

      Change notifications to be subscribed to.

      Parameters:
      changes - values to be set
    • setChanges

      void setChanges(List<ChangeSubscription> changes)

      Change notifications to be subscribed to.

      Parameters:
      changes - values to be set
    • setDestination

      void setDestination(Destination destination)

      Messaging service to which the messages are sent.

      Parameters:
      destination - value to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier for the Subscription.

      Parameters:
      key - value to be set
    • setMessages

      void setMessages(MessageSubscription... messages)

      Messages to be subscribed to.

      Parameters:
      messages - values to be set
    • setMessages

      void setMessages(List<MessageSubscription> messages)

      Messages to be subscribed to.

      Parameters:
      messages - values to be set
    • setFormat

      void setFormat(DeliveryFormat format)

      Format in which the payload is delivered. When not provided, the PlatformFormat is selected by default.

      Parameters:
      format - value to be set
    • of

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

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

      factory method to create a deep copy of SubscriptionDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static SubscriptionDraftBuilder builder()
      builder factory method for SubscriptionDraft
      Returns:
      builder
    • builder

      static SubscriptionDraftBuilder builder(SubscriptionDraft template)
      create builder for SubscriptionDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withSubscriptionDraft

      default <T> T withSubscriptionDraft(Function<SubscriptionDraft,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<SubscriptionDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference