Class EventSubscriptionBuilder

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

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

     EventSubscription eventSubscription = EventSubscription.builder()
             .resourceTypeId(EventSubscriptionResourceTypeId.CHECKOUT)
             .build()
 
  • Constructor Details

    • EventSubscriptionBuilder

      public EventSubscriptionBuilder()
  • Method Details

    • resourceTypeId

      public EventSubscriptionBuilder resourceTypeId(EventSubscriptionResourceTypeId resourceTypeId)

      Unique identifier for the type of resource.

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

      public EventSubscriptionBuilder types(@Nullable EventType... types)

      Must contain valid event types for the resource. For example, for resource type import-api the event type ImportContainerCreated is valid. If no types are given, the Subscription will receive all events for the defined resource type.

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

      public EventSubscriptionBuilder types(@Nullable List<EventType> types)

      Must contain valid event types for the resource. For example, for resource type import-api the event type ImportContainerCreated is valid. If no types are given, the Subscription will receive all events for the defined resource type.

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

      public EventSubscriptionBuilder plusTypes(@Nullable EventType... types)

      Must contain valid event types for the resource. For example, for resource type import-api the event type ImportContainerCreated is valid. If no types are given, the Subscription will receive all events for the defined resource type.

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

      public EventSubscriptionResourceTypeId getResourceTypeId()

      Unique identifier for the type of resource.

      Returns:
      resourceTypeId
    • getTypes

      @Nullable public List<EventType> getTypes()

      Must contain valid event types for the resource. For example, for resource type import-api the event type ImportContainerCreated is valid. If no types are given, the Subscription will receive all events for the defined resource type.

      Returns:
      types
    • build

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

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

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

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