Class ExtensionDraftBuilder

java.lang.Object
com.commercetools.api.models.extension.ExtensionDraftBuilder
All Implemented Interfaces:
Builder<ExtensionDraft>

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

     ExtensionDraft extensionDraft = ExtensionDraft.builder()
             .destination(destinationBuilder -> destinationBuilder)
             .plusTriggers(triggersBuilder -> triggersBuilder)
             .build()
 
  • Constructor Details

    • ExtensionDraftBuilder

      public ExtensionDraftBuilder()
  • Method Details

    • key

      User-defined unique identifier for the Extension.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • destination

      public ExtensionDraftBuilder destination(ExtensionDestination destination)

      Defines where the Extension can be reached.

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

      Defines where the Extension can be reached.

      Parameters:
      builder - function to build the destination value
      Returns:
      Builder
    • triggers

      public ExtensionDraftBuilder triggers(ExtensionTrigger... triggers)

      Describes what triggers the Extension.

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

      public ExtensionDraftBuilder triggers(List<ExtensionTrigger> triggers)

      Describes what triggers the Extension.

      Parameters:
      triggers - value to be set
      Returns:
      Builder
    • plusTriggers

      public ExtensionDraftBuilder plusTriggers(ExtensionTrigger... triggers)

      Describes what triggers the Extension.

      Parameters:
      triggers - value to be set
      Returns:
      Builder
    • plusTriggers

      Describes what triggers the Extension.

      Parameters:
      builder - function to build the triggers value
      Returns:
      Builder
    • withTriggers

      Describes what triggers the Extension.

      Parameters:
      builder - function to build the triggers value
      Returns:
      Builder
    • addTriggers

      Describes what triggers the Extension.

      Parameters:
      builder - function to build the triggers value
      Returns:
      Builder
    • setTriggers

      Describes what triggers the Extension.

      Parameters:
      builder - function to build the triggers value
      Returns:
      Builder
    • timeoutInMs

      public ExtensionDraftBuilder timeoutInMs(@Nullable Integer timeoutInMs)

      Maximum time (in milliseconds) the Extension can respond within. If no timeout is provided, the default value is used for all types of Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.

      This limit can be increased per Project after we review the performance impact. Please contact the Composable Commerce support team and provide the Region, Project key, and use case.

      Parameters:
      timeoutInMs - value to be set
      Returns:
      Builder
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the Extension.

      Returns:
      key
    • getDestination

      public ExtensionDestination getDestination()

      Defines where the Extension can be reached.

      Returns:
      destination
    • getTriggers

      public List<ExtensionTrigger> getTriggers()

      Describes what triggers the Extension.

      Returns:
      triggers
    • getTimeoutInMs

      @Nullable public Integer getTimeoutInMs()

      Maximum time (in milliseconds) the Extension can respond within. If no timeout is provided, the default value is used for all types of Extensions. The maximum value is 10000 ms (10 seconds) for payment Extensions and 2000 ms (2 seconds) for all other Extensions.

      This limit can be increased per Project after we review the performance impact. Please contact the Composable Commerce support team and provide the Region, Project key, and use case.

      Returns:
      timeoutInMs
    • build

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

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

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

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