Class MessageSubscriptionBuilder

java.lang.Object
com.commercetools.api.models.subscription.MessageSubscriptionBuilder
All Implemented Interfaces:
Builder<MessageSubscription>

public class MessageSubscriptionBuilder extends Object implements Builder<MessageSubscription>
MessageSubscriptionBuilder
Example to create an instance using the builder pattern

     MessageSubscription messageSubscription = MessageSubscription.builder()
             .resourceTypeId(MessageSubscriptionResourceTypeId.APPROVAL_FLOW)
             .build()
 
  • Constructor Details

    • MessageSubscriptionBuilder

      public MessageSubscriptionBuilder()
  • Method Details

    • resourceTypeId

      public MessageSubscriptionBuilder resourceTypeId(MessageSubscriptionResourceTypeId resourceTypeId)

      Unique identifier for the type of resource, for example, order.

      Parameters:
      resourceTypeId - value to be set
      Returns:
      Builder
    • types

      public MessageSubscriptionBuilder types(@Nullable String... types)

      Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. If no types of messages are given, the Subscription will receive all messages for this resource.

      Parameters:
      types - value to be set
      Returns:
      Builder
    • types

      Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. If no types of messages are given, the Subscription will receive all messages for this resource.

      Parameters:
      types - value to be set
      Returns:
      Builder
    • plusTypes

      public MessageSubscriptionBuilder plusTypes(@Nullable String... types)

      Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. If no types of messages are given, the Subscription will receive all messages for this resource.

      Parameters:
      types - value to be set
      Returns:
      Builder
    • getResourceTypeId

      public MessageSubscriptionResourceTypeId getResourceTypeId()

      Unique identifier for the type of resource, for example, order.

      Returns:
      resourceTypeId
    • getTypes

      @Nullable public List<String> getTypes()

      Must contain valid message types for the resource. For example, for resource type product the message type ProductPublished is valid. If no types of messages are given, the Subscription will receive all messages for this resource.

      Returns:
      types
    • build

      public MessageSubscription build()
      builds MessageSubscription with checking for non-null required values
      Specified by:
      build in interface Builder<MessageSubscription>
      Returns:
      MessageSubscription
    • buildUnchecked

      public MessageSubscription buildUnchecked()
      builds MessageSubscription without checking for non-null required values
      Returns:
      MessageSubscription
    • of

      public static MessageSubscriptionBuilder of()
      factory method for an instance of MessageSubscriptionBuilder
      Returns:
      builder
    • of

      public static MessageSubscriptionBuilder of(MessageSubscription template)
      create builder for MessageSubscription instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder