Class ExtensionDraftBuilder
- All Implemented Interfaces:
Builder<ExtensionDraft>
Example to create an instance using the builder pattern
ExtensionDraft extensionDraft = ExtensionDraft.builder()
.destination(destinationBuilder -> destinationBuilder)
.plusTriggers(triggersBuilder -> triggersBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExtensions that must complete before this Extension is called, identified byidorkey.additionalContext(ExtensionAdditionalContextDraft additionalContext) Configures additional information included in the payload sent to the API Extension.additionalContext(Function<ExtensionAdditionalContextDraftBuilder, ExtensionAdditionalContextDraftBuilder> builder) Configures additional information included in the payload sent to the API Extension.Describes what triggers the Extension.build()builds ExtensionDraft with checking for non-null required valuesbuilds ExtensionDraft without checking for non-null required valuesdependencies(ExtensionResourceIdentifier... dependencies) Extensions that must complete before this Extension is called, identified byidorkey.dependencies(List<ExtensionResourceIdentifier> dependencies) Extensions that must complete before this Extension is called, identified byidorkey.destination(ExtensionDestination destination) Defines where the Extension can be reached.destination(Function<ExtensionDestinationBuilder, Builder<? extends ExtensionDestination>> builder) Defines where the Extension can be reached.expansionPaths(String... expansionPaths) Expansion paths used for reference expansion of the payload.expansionPaths(List<String> expansionPaths) Expansion paths used for reference expansion of the payload.Configures additional information included in the payload sent to the API Extension.Extensions that must complete before this Extension is called, identified byidorkey.Defines where the Extension can be reached.Expansion paths used for reference expansion of the payload.getKey()User-defined unique identifier for the Extension.Maximum time (in milliseconds) the Extension can respond within.Describes what triggers the Extension.User-defined unique identifier for the Extension.static ExtensionDraftBuilderof()factory method for an instance of ExtensionDraftBuilderstatic ExtensionDraftBuilderof(ExtensionDraft template) create builder for ExtensionDraft instanceplusDependencies(ExtensionResourceIdentifier... dependencies) Extensions that must complete before this Extension is called, identified byidorkey.plusDependencies(Function<ExtensionResourceIdentifierBuilder, ExtensionResourceIdentifierBuilder> builder) Extensions that must complete before this Extension is called, identified byidorkey.plusExpansionPaths(String... expansionPaths) Expansion paths used for reference expansion of the payload.plusTriggers(ExtensionTrigger... triggers) Describes what triggers the Extension.Describes what triggers the Extension.Extensions that must complete before this Extension is called, identified byidorkey.Describes what triggers the Extension.timeoutInMs(Integer timeoutInMs) Maximum time (in milliseconds) the Extension can respond within.triggers(ExtensionTrigger... triggers) Describes what triggers the Extension.triggers(List<ExtensionTrigger> triggers) Describes what triggers the Extension.withAdditionalContext(Function<ExtensionAdditionalContextDraftBuilder, ExtensionAdditionalContextDraft> builder) Configures additional information included in the payload sent to the API Extension.withDependencies(Function<ExtensionResourceIdentifierBuilder, ExtensionResourceIdentifierBuilder> builder) Extensions that must complete before this Extension is called, identified byidorkey.Describes what triggers the Extension.
-
Constructor Details
-
ExtensionDraftBuilder
public ExtensionDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier for the Extension.
- Parameters:
key- value to be set- Returns:
- Builder
-
destination
Defines where the Extension can be reached.
- Parameters:
destination- value to be set- Returns:
- Builder
-
destination
public ExtensionDraftBuilder destination(Function<ExtensionDestinationBuilder, Builder<? extends ExtensionDestination>> builder) Defines where the Extension can be reached.
- Parameters:
builder- function to build the destination value- Returns:
- Builder
-
triggers
Describes what triggers the Extension.
- Parameters:
triggers- value to be set- Returns:
- Builder
-
triggers
Describes what triggers the Extension.
- Parameters:
triggers- value to be set- Returns:
- Builder
-
plusTriggers
Describes what triggers the Extension.
- Parameters:
triggers- value to be set- Returns:
- Builder
-
plusTriggers
public ExtensionDraftBuilder plusTriggers(Function<ExtensionTriggerBuilder, ExtensionTriggerBuilder> builder) Describes what triggers the Extension.
- Parameters:
builder- function to build the triggers value- Returns:
- Builder
-
withTriggers
public ExtensionDraftBuilder withTriggers(Function<ExtensionTriggerBuilder, ExtensionTriggerBuilder> builder) Describes what triggers the Extension.
- Parameters:
builder- function to build the triggers value- Returns:
- Builder
-
addTriggers
public ExtensionDraftBuilder addTriggers(Function<ExtensionTriggerBuilder, ExtensionTrigger> builder) Describes what triggers the Extension.
- Parameters:
builder- function to build the triggers value- Returns:
- Builder
-
setTriggers
public ExtensionDraftBuilder setTriggers(Function<ExtensionTriggerBuilder, ExtensionTrigger> builder) Describes what triggers the Extension.
- Parameters:
builder- function to build the triggers value- Returns:
- Builder
-
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
Extensions that must complete before this Extension is called, identified by
idorkey. 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
Extensions that must complete before this Extension is called, identified by
idorkey. 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
idorkey. 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(Function<ExtensionResourceIdentifierBuilder, ExtensionResourceIdentifierBuilder> builder) Extensions that must complete before this Extension is called, identified by
idorkey. 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
public ExtensionDraftBuilder withDependencies(Function<ExtensionResourceIdentifierBuilder, ExtensionResourceIdentifierBuilder> builder) Extensions that must complete before this Extension is called, identified by
idorkey. 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
public ExtensionDraftBuilder addDependencies(Function<ExtensionResourceIdentifierBuilder, ExtensionResourceIdentifier> builder) Extensions that must complete before this Extension is called, identified by
idorkey. 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
public ExtensionDraftBuilder setDependencies(Function<ExtensionResourceIdentifierBuilder, ExtensionResourceIdentifier> builder) Extensions that must complete before this Extension is called, identified by
idorkey. 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
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
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
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
public ExtensionDraftBuilder additionalContext(Function<ExtensionAdditionalContextDraftBuilder, ExtensionAdditionalContextDraftBuilder> builder) Configures additional information included in the payload sent to the API Extension.
- Parameters:
builder- function to build the additionalContext value- Returns:
- Builder
-
withAdditionalContext
public ExtensionDraftBuilder withAdditionalContext(Function<ExtensionAdditionalContextDraftBuilder, ExtensionAdditionalContextDraft> builder) 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
User-defined unique identifier for the Extension.
- Returns:
- key
-
getDestination
Defines where the Extension can be reached.
- Returns:
- destination
-
getTriggers
Describes what triggers the Extension.
- Returns:
- triggers
-
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
Extensions that must complete before this Extension is called, identified by
idorkey. Maximum 5 entries. If omitted, the Extension has no dependencies and may run concurrently with other independent Extensions.- Returns:
- dependencies
-
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
Configures additional information included in the payload sent to the API Extension.
- Returns:
- additionalContext
-
build
builds ExtensionDraft with checking for non-null required values- Specified by:
buildin interfaceBuilder<ExtensionDraft>- Returns:
- ExtensionDraft
-
buildUnchecked
builds ExtensionDraft without checking for non-null required values- Returns:
- ExtensionDraft
-
of
factory method for an instance of ExtensionDraftBuilder- Returns:
- builder
-
of
create builder for ExtensionDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-