Class VariantBuilder
Example to create an instance using the builder pattern
Variant variant = Variant.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.variantId(0.3)
.product(productBuilder -> productBuilder)
.published(true)
.current(currentBuilder -> currentBuilder)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()builds Variant with checking for non-null required valuesbuilds Variant without checking for non-null required valuescreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Variant was initially created.IDs and references that created the Variant.createdBy(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the Variant.current(VariantData current) The current data of the Variant.current(Function<VariantDataBuilder, VariantDataBuilder> builder) The current data of the Variant.Date and time (UTC) the Variant was initially created.IDs and references that created the Variant.The current data of the Variant.getId()Unique identifier of the Variant.getKey()User-defined unique identifier of the Variant.Date and time (UTC) the Variant was last updated.IDs and references that last modified the Variant.Reference to the parent Product the Variant belongs to.trueif the Variant is published,falseif it is unpublished.The staged data of the Variant.A unique, sequential identifier of the Variant within the parent Product.Current version of the Variant.Unique identifier of the Variant.User-defined unique identifier of the Variant.lastModifiedAt(ZonedDateTime lastModifiedAt) Date and time (UTC) the Variant was last updated.lastModifiedBy(LastModifiedBy lastModifiedBy) IDs and references that last modified the Variant.IDs and references that last modified the Variant.static VariantBuilderof()factory method for an instance of VariantBuilderstatic VariantBuildercreate builder for Variant instanceproduct(ProductReference product) Reference to the parent Product the Variant belongs to.Reference to the parent Product the Variant belongs to.trueif the Variant is published,falseif it is unpublished.staged(VariantData staged) The staged data of the Variant.staged(Function<VariantDataBuilder, VariantDataBuilder> builder) The staged data of the Variant.A unique, sequential identifier of the Variant within the parent Product.Current version of the Variant.withCreatedBy(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the Variant.withCurrent(Function<VariantDataBuilder, VariantData> builder) The current data of the Variant.IDs and references that last modified the Variant.Reference to the parent Product the Variant belongs to.withStaged(Function<VariantDataBuilder, VariantData> builder) The staged data of the Variant.
-
Constructor Details
-
VariantBuilder
public VariantBuilder()
-
-
Method Details
-
id
Unique identifier of the Variant.
- Parameters:
id- value to be set- Returns:
- Builder
-
version
Current version of the Variant.
- Parameters:
version- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Variant was initially created.
- Parameters:
createdAt- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Variant was last updated.
- Parameters:
lastModifiedAt- value to be set- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the Variant.
- Parameters:
builder- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
IDs and references that last modified the Variant.
- Parameters:
builder- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the Variant.
- Parameters:
lastModifiedBy- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the Variant.
- Parameters:
builder- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the Variant.
- Parameters:
builder- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the Variant.
- Parameters:
createdBy- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the Variant. This is different from Product
key.- Parameters:
key- value to be set- Returns:
- Builder
-
variantId
A unique, sequential identifier of the Variant within the parent Product.
- Parameters:
variantId- value to be set- Returns:
- Builder
-
product
Reference to the parent Product the Variant belongs to.
- Parameters:
builder- function to build the product value- Returns:
- Builder
-
withProduct
Reference to the parent Product the Variant belongs to.
- Parameters:
builder- function to build the product value- Returns:
- Builder
-
product
Reference to the parent Product the Variant belongs to.
- Parameters:
product- value to be set- Returns:
- Builder
-
published
trueif the Variant is published,falseif it is unpublished.- Parameters:
published- value to be set- Returns:
- Builder
-
current
The current data of the Variant.
- Parameters:
builder- function to build the current value- Returns:
- Builder
-
withCurrent
The current data of the Variant.
- Parameters:
builder- function to build the current value- Returns:
- Builder
-
current
The current data of the Variant.
- Parameters:
current- value to be set- Returns:
- Builder
-
staged
The staged data of the Variant. Only present if there are staged changes that differ from the current data.
- Parameters:
builder- function to build the staged value- Returns:
- Builder
-
withStaged
The staged data of the Variant. Only present if there are staged changes that differ from the current data.
- Parameters:
builder- function to build the staged value- Returns:
- Builder
-
staged
The staged data of the Variant. Only present if there are staged changes that differ from the current data.
- Parameters:
staged- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Variant.
- Returns:
- id
-
getVersion
Current version of the Variant.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Variant was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Variant was last updated.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the Variant.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the Variant.
- Returns:
- createdBy
-
getKey
User-defined unique identifier of the Variant. This is different from Product
key.- Returns:
- key
-
getVariantId
A unique, sequential identifier of the Variant within the parent Product.
- Returns:
- variantId
-
getProduct
Reference to the parent Product the Variant belongs to.
- Returns:
- product
-
getPublished
trueif the Variant is published,falseif it is unpublished.- Returns:
- published
-
getCurrent
The current data of the Variant.
- Returns:
- current
-
getStaged
The staged data of the Variant. Only present if there are staged changes that differ from the current data.
- Returns:
- staged
-
build
builds Variant with checking for non-null required values -
buildUnchecked
builds Variant without checking for non-null required values- Returns:
- Variant
-
of
factory method for an instance of VariantBuilder- Returns:
- builder
-
of
create builder for Variant instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-