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

      public ExtensionDraftBuilder key(@Nullable String 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. We recommend keeping the timeout as low as possible to avoid performance issues.

      The limit of 10000 ms (10 seconds) can be increased per Project after we review the performance impact. Please contact the commercetools support team and provide the Region, Project key, and use case.

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

      public ExtensionDraftBuilder dependencies(@Nullable ExtensionResourceIdentifier... dependencies)

      Extensions that must complete before this Extension is called, identified by id or key. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.

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

      public ExtensionDraftBuilder dependencies(@Nullable List<ExtensionResourceIdentifier> dependencies)

      Extensions that must complete before this Extension is called, identified by id or key. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.

      Parameters:
      dependencies - value to be set
      Returns:
      Builder
    • plusDependencies

      public ExtensionDraftBuilder plusDependencies(@Nullable ExtensionResourceIdentifier... dependencies)

      Extensions that must complete before this Extension is called, identified by id or key. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.

      Parameters:
      dependencies - value to be set
      Returns:
      Builder
    • plusDependencies

      Extensions that must complete before this Extension is called, identified by id or key. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.

      Parameters:
      builder - function to build the dependencies value
      Returns:
      Builder
    • withDependencies

      Extensions that must complete before this Extension is called, identified by id or key. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.

      Parameters:
      builder - function to build the dependencies value
      Returns:
      Builder
    • addDependencies

      Extensions that must complete before this Extension is called, identified by id or key. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.

      Parameters:
      builder - function to build the dependencies value
      Returns:
      Builder
    • setDependencies

      Extensions that must complete before this Extension is called, identified by id or key. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.

      Parameters:
      builder - function to build the dependencies value
      Returns:
      Builder
    • expansionPaths

      public ExtensionDraftBuilder expansionPaths(@Nullable String... expansionPaths)

      Expansion paths used for reference expansion of the payload.

      Be aware of the limits of this feature and its performance impact.

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

      public ExtensionDraftBuilder expansionPaths(@Nullable List<String> expansionPaths)

      Expansion paths used for reference expansion of the payload.

      Be aware of the limits of this feature and its performance impact.

      Parameters:
      expansionPaths - value to be set
      Returns:
      Builder
    • plusExpansionPaths

      public ExtensionDraftBuilder plusExpansionPaths(@Nullable String... expansionPaths)

      Expansion paths used for reference expansion of the payload.

      Be aware of the limits of this feature and its performance impact.

      Parameters:
      expansionPaths - value to be set
      Returns:
      Builder
    • additionalContext

      Configures additional information included in the payload sent to the API Extension.

      Parameters:
      builder - function to build the additionalContext value
      Returns:
      Builder
    • withAdditionalContext

      Configures additional information included in the payload sent to the API Extension.

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

      public ExtensionDraftBuilder additionalContext(@Nullable ExtensionAdditionalContextDraft additionalContext)

      Configures additional information included in the payload sent to the API Extension.

      Parameters:
      additionalContext - 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. We recommend keeping the timeout as low as possible to avoid performance issues.

      The limit of 10000 ms (10 seconds) can be increased per Project after we review the performance impact. Please contact the commercetools support team and provide the Region, Project key, and use case.

      Returns:
      timeoutInMs
    • getDependencies

      @Nullable public List<ExtensionResourceIdentifier> getDependencies()

      Extensions that must complete before this Extension is called, identified by id or key. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.

      Returns:
      dependencies
    • getExpansionPaths

      @Nullable public List<String> getExpansionPaths()

      Expansion paths used for reference expansion of the payload.

      Be aware of the limits of this feature and its performance impact.

      Returns:
      expansionPaths
    • getAdditionalContext

      @Nullable public ExtensionAdditionalContextDraft getAdditionalContext()

      Configures additional information included in the payload sent to the API Extension.

      Returns:
      additionalContext
    • 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