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
-
Method Summary
Modifier and TypeMethodDescriptionDescribes what triggers the Extension.build()
builds ExtensionDraft with checking for non-null required valuesbuilds ExtensionDraft without checking for non-null required valuesdestination
(ExtensionDestination destination) Defines where the Extension can be reached.destination
(Function<ExtensionDestinationBuilder, Builder<? extends ExtensionDestination>> builder) Defines where the Extension can be reached.Defines where the Extension can be reached.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 ExtensionDraftBuilder
of()
factory method for an instance of ExtensionDraftBuilderstatic ExtensionDraftBuilder
of
(ExtensionDraft template) create builder for ExtensionDraft instanceplusTriggers
(ExtensionTrigger... triggers) Describes what triggers the Extension.Describes what triggers the Extension.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.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. 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
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. 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
builds ExtensionDraft with checking for non-null required values- Specified by:
build
in 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
-