Class ExtensionBuilder
Example to create an instance using the builder pattern
Extension extension = Extension.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.destination(destinationBuilder -> destinationBuilder)
.plusTriggers(triggersBuilder -> triggersBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReferences to other Extensions that must complete before this Extension is called.additionalContext(ExtensionAdditionalContext additionalContext) Configures additional information included in the payload sent to the API Extension.additionalContext(Function<ExtensionAdditionalContextBuilder, ExtensionAdditionalContextBuilder> builder) Configures additional information included in the payload sent to the API Extension.Describes what triggers the Extension.build()builds Extension with checking for non-null required valuesbuilds Extension without checking for non-null required valuescreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Extension was initially created.IDs and references that created the Extension.createdBy(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the Extension.dependencies(ExtensionReference... dependencies) References to other Extensions that must complete before this Extension is called.dependencies(List<ExtensionReference> dependencies) References to other Extensions that must complete before this Extension is called.destination(ExtensionDestination destination) The configuration for the Extension, including its type, location and authentication details.destination(Function<ExtensionDestinationBuilder, Builder<? extends ExtensionDestination>> builder) The configuration for the Extension, including its type, location and authentication details.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.Date and time (UTC) the Extension was initially created.IDs and references that created the Extension.References to other Extensions that must complete before this Extension is called.The configuration for the Extension, including its type, location and authentication details.Expansion paths used for reference expansion of the payload.getId()Unique identifier of the Extension.getKey()User-defined unique identifier of the Extension.Date and time (UTC) the Extension was last updated.IDs and references that last modified the Extension.Maximum time (in milliseconds) that the Extension can respond within.Describes what triggers the Extension.Current version of the Extension.Unique identifier of the Extension.User-defined unique identifier of the Extension.lastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the Extension was last updated.lastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified the Extension.IDs and references that last modified the Extension.static ExtensionBuilderof()factory method for an instance of ExtensionBuilderstatic ExtensionBuildercreate builder for Extension instanceplusDependencies(ExtensionReference... dependencies) References to other Extensions that must complete before this Extension is called.References to other Extensions that must complete before this Extension is called.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.References to other Extensions that must complete before this Extension is called.Describes what triggers the Extension.timeoutInMs(Integer timeoutInMs) Maximum time (in milliseconds) that the Extension can respond within.triggers(ExtensionTrigger... triggers) Describes what triggers the Extension.triggers(List<ExtensionTrigger> triggers) Describes what triggers the Extension.Current version of the Extension.withAdditionalContext(Function<ExtensionAdditionalContextBuilder, ExtensionAdditionalContext> builder) Configures additional information included in the payload sent to the API Extension.withCreatedBy(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the Extension.References to other Extensions that must complete before this Extension is called.IDs and references that last modified the Extension.Describes what triggers the Extension.
-
Constructor Details
-
ExtensionBuilder
public ExtensionBuilder()
-
-
Method Details
-
id
Unique identifier of the Extension.
- Parameters:
id- value to be set- Returns:
- Builder
-
version
Current version of the Extension.
- Parameters:
version- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Extension was initially created.
- Parameters:
createdAt- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Extension was last updated.
- Parameters:
lastModifiedAt- value to be set- Returns:
- Builder
-
lastModifiedBy
public ExtensionBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the Extension.
- Parameters:
builder- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
IDs and references that last modified the Extension.
- Parameters:
builder- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the Extension.
- Parameters:
lastModifiedBy- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the Extension.
- Parameters:
builder- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the Extension.
- Parameters:
builder- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the Extension.
- Parameters:
createdBy- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Extension.
- Parameters:
key- value to be set- Returns:
- Builder
-
destination
The configuration for the Extension, including its type, location and authentication details.
- Parameters:
destination- value to be set- Returns:
- Builder
-
destination
public ExtensionBuilder destination(Function<ExtensionDestinationBuilder, Builder<? extends ExtensionDestination>> builder) The configuration for the Extension, including its type, location and authentication details.
- 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 ExtensionBuilder plusTriggers(Function<ExtensionTriggerBuilder, ExtensionTriggerBuilder> builder) Describes what triggers the Extension.
- Parameters:
builder- function to build the triggers value- Returns:
- Builder
-
withTriggers
public ExtensionBuilder withTriggers(Function<ExtensionTriggerBuilder, ExtensionTriggerBuilder> builder) 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
Maximum time (in milliseconds) that the Extension can respond within. If no timeout is provided, the default value is used for all types of Extensions.
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
References to other Extensions that must complete before this Extension is called. The Extension receives the resource state after all transitive ancestors' update actions have been applied. Maximum 5 entries.
- Parameters:
dependencies- value to be set- Returns:
- Builder
-
dependencies
References to other Extensions that must complete before this Extension is called. The Extension receives the resource state after all transitive ancestors' update actions have been applied. Maximum 5 entries.
- Parameters:
dependencies- value to be set- Returns:
- Builder
-
plusDependencies
References to other Extensions that must complete before this Extension is called. The Extension receives the resource state after all transitive ancestors' update actions have been applied. Maximum 5 entries.
- Parameters:
dependencies- value to be set- Returns:
- Builder
-
plusDependencies
public ExtensionBuilder plusDependencies(Function<ExtensionReferenceBuilder, ExtensionReferenceBuilder> builder) References to other Extensions that must complete before this Extension is called. The Extension receives the resource state after all transitive ancestors' update actions have been applied. Maximum 5 entries.
- Parameters:
builder- function to build the dependencies value- Returns:
- Builder
-
withDependencies
public ExtensionBuilder withDependencies(Function<ExtensionReferenceBuilder, ExtensionReferenceBuilder> builder) References to other Extensions that must complete before this Extension is called. The Extension receives the resource state after all transitive ancestors' update actions have been applied. Maximum 5 entries.
- Parameters:
builder- function to build the dependencies value- Returns:
- Builder
-
addDependencies
public ExtensionBuilder addDependencies(Function<ExtensionReferenceBuilder, ExtensionReference> builder) References to other Extensions that must complete before this Extension is called. The Extension receives the resource state after all transitive ancestors' update actions have been applied. Maximum 5 entries.
- Parameters:
builder- function to build the dependencies value- Returns:
- Builder
-
setDependencies
public ExtensionBuilder setDependencies(Function<ExtensionReferenceBuilder, ExtensionReference> builder) References to other Extensions that must complete before this Extension is called. The Extension receives the resource state after all transitive ancestors' update actions have been applied. Maximum 5 entries.
- 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 ExtensionBuilder additionalContext(Function<ExtensionAdditionalContextBuilder, ExtensionAdditionalContextBuilder> 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 ExtensionBuilder withAdditionalContext(Function<ExtensionAdditionalContextBuilder, ExtensionAdditionalContext> builder) Configures additional information included in the payload sent to the API Extension.
- Parameters:
builder- function to build the additionalContext value- Returns:
- Builder
-
additionalContext
Configures additional information included in the payload sent to the API Extension.
- Parameters:
additionalContext- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Extension.
- Returns:
- id
-
getVersion
Current version of the Extension.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Extension was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Extension was last updated.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the Extension.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Extension.
- Returns:
- createdBy
-
getKey
User-defined unique identifier of the Extension.
- Returns:
- key
-
getDestination
The configuration for the Extension, including its type, location and authentication details.
- Returns:
- destination
-
getTriggers
Describes what triggers the Extension.
- Returns:
- triggers
-
getTimeoutInMs
Maximum time (in milliseconds) that the Extension can respond within. If no timeout is provided, the default value is used for all types of Extensions.
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
References to other Extensions that must complete before this Extension is called. The Extension receives the resource state after all transitive ancestors' update actions have been applied. Maximum 5 entries.
- 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 Extension with checking for non-null required values -
buildUnchecked
builds Extension without checking for non-null required values- Returns:
- Extension
-
of
factory method for an instance of ExtensionBuilder- Returns:
- builder
-
of
create builder for Extension instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-