Class ProductDiscountBuilder
- All Implemented Interfaces:
Builder<ProductDiscount>
Example to create an instance using the builder pattern
ProductDiscount productDiscount = ProductDiscount.builder()
.id("{id}")
.version(0.3)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.name(nameBuilder -> nameBuilder)
.value(valueBuilder -> valueBuilder)
.predicate("{predicate}")
.sortOrder("{sortOrder}")
.isActive(true)
.plusReferences(referencesBuilder -> referencesBuilder)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds ProductDiscount with checking for non-null required valuesbuilds ProductDiscount without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the ProductDiscount was initially created.IDs and references that created the ProductDiscount.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the ProductDiscount.description
(LocalizedString description) Description of the ProductDiscount.Description of the ProductDiscount.Date and time (UTC) the ProductDiscount was initially created.IDs and references that created the ProductDiscount.Description of the ProductDiscount.getId()
Unique identifier of the ProductDiscount.Iftrue
the Product Discount is applied to Products matching thepredicate
.getKey()
User-defined unique identifier of the ProductDiscount.Date and time (UTC) the ProductDiscount was last updated.IDs and references that last modified the ProductDiscount.getName()
Name of the ProductDiscount.Valid ProductDiscount predicate.References of all the resources that are addressed in thepredicate
.Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active.Date and time (UTC) from which the Discount is effective.Date and time (UTC) until which the Discount is effective.getValue()
Type of Discount and its corresponding value.Current version of the ProductDiscount.Unique identifier of the ProductDiscount.Iftrue
the Product Discount is applied to Products matching thepredicate
.User-defined unique identifier of the ProductDiscount.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the ProductDiscount was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the ProductDiscount.IDs and references that last modified the ProductDiscount.name
(LocalizedString name) Name of the ProductDiscount.Name of the ProductDiscount.static ProductDiscountBuilder
of()
factory method for an instance of ProductDiscountBuilderstatic ProductDiscountBuilder
of
(ProductDiscount template) create builder for ProductDiscount instanceplusReferences
(Reference... references) References of all the resources that are addressed in thepredicate
.plusReferences
(Function<ReferenceBuilder, Builder<? extends Reference>> builder) References of all the resources that are addressed in thepredicate
.Valid ProductDiscount predicate.references
(Reference... references) References of all the resources that are addressed in thepredicate
.references
(List<Reference> references) References of all the resources that are addressed in thepredicate
.Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active.validFrom
(ZonedDateTime validFrom) Date and time (UTC) from which the Discount is effective.validUntil
(ZonedDateTime validUntil) Date and time (UTC) until which the Discount is effective.value
(ProductDiscountValue value) Type of Discount and its corresponding value.value
(Function<ProductDiscountValueBuilder, Builder<? extends ProductDiscountValue>> builder) Type of Discount and its corresponding value.Current version of the ProductDiscount.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the ProductDiscount.Description of the ProductDiscount.IDs and references that last modified the ProductDiscount.Name of the ProductDiscount.withReferences
(Function<ReferenceBuilder, Builder<? extends Reference>> builder) References of all the resources that are addressed in thepredicate
.
-
Constructor Details
-
ProductDiscountBuilder
public ProductDiscountBuilder()
-
-
Method Details
-
id
Unique identifier of the ProductDiscount.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the ProductDiscount.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the ProductDiscount was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the ProductDiscount was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
lastModifiedBy
public ProductDiscountBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the ProductDiscount.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
public ProductDiscountBuilder withLastModifiedBy(Function<LastModifiedByBuilder, LastModifiedBy> builder) IDs and references that last modified the ProductDiscount.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the ProductDiscount.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the ProductDiscount.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the ProductDiscount.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the ProductDiscount.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
name
Name of the ProductDiscount.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
Name of the ProductDiscount.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the ProductDiscount.
- Parameters:
name
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the ProductDiscount.
- Parameters:
key
- value to be set- Returns:
- Builder
-
description
public ProductDiscountBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description of the ProductDiscount.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
public ProductDiscountBuilder withDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Description of the ProductDiscount.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
description
Description of the ProductDiscount.
- Parameters:
description
- value to be set- Returns:
- Builder
-
value
Type of Discount and its corresponding value.
- Parameters:
value
- value to be set- Returns:
- Builder
-
value
public ProductDiscountBuilder value(Function<ProductDiscountValueBuilder, Builder<? extends ProductDiscountValue>> builder) Type of Discount and its corresponding value.
- Parameters:
builder
- function to build the value value- Returns:
- Builder
-
predicate
Valid ProductDiscount predicate.
- Parameters:
predicate
- value to be set- Returns:
- Builder
-
sortOrder
Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. A Product Discount with a higher value is prioritized.
- Parameters:
sortOrder
- value to be set- Returns:
- Builder
-
isActive
If
true
the Product Discount is applied to Products matching thepredicate
.- Parameters:
isActive
- value to be set- Returns:
- Builder
-
references
References of all the resources that are addressed in the
predicate
.- Parameters:
references
- value to be set- Returns:
- Builder
-
references
References of all the resources that are addressed in the
predicate
.- Parameters:
references
- value to be set- Returns:
- Builder
-
plusReferences
References of all the resources that are addressed in the
predicate
.- Parameters:
references
- value to be set- Returns:
- Builder
-
plusReferences
public ProductDiscountBuilder plusReferences(Function<ReferenceBuilder, Builder<? extends Reference>> builder) References of all the resources that are addressed in the
predicate
.- Parameters:
builder
- function to build the references value- Returns:
- Builder
-
withReferences
public ProductDiscountBuilder withReferences(Function<ReferenceBuilder, Builder<? extends Reference>> builder) References of all the resources that are addressed in the
predicate
.- Parameters:
builder
- function to build the references value- Returns:
- Builder
-
validFrom
Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.
- Parameters:
validFrom
- value to be set- Returns:
- Builder
-
validUntil
Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.
- Parameters:
validUntil
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the ProductDiscount.
- Returns:
- id
-
getVersion
Current version of the ProductDiscount.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the ProductDiscount was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the ProductDiscount was last updated.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the ProductDiscount.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the ProductDiscount.
- Returns:
- createdBy
-
getName
Name of the ProductDiscount.
- Returns:
- name
-
getKey
User-defined unique identifier of the ProductDiscount.
- Returns:
- key
-
getDescription
Description of the ProductDiscount.
- Returns:
- description
-
getValue
Type of Discount and its corresponding value.
- Returns:
- value
-
getPredicate
Valid ProductDiscount predicate.
- Returns:
- predicate
-
getSortOrder
Unique decimal value between 0 and 1 (stored as String literal) defining the order of Product Discounts to apply in case more than one is applicable and active. A Product Discount with a higher value is prioritized.
- Returns:
- sortOrder
-
getIsActive
If
true
the Product Discount is applied to Products matching thepredicate
.- Returns:
- isActive
-
getReferences
References of all the resources that are addressed in the
predicate
.- Returns:
- references
-
getValidFrom
Date and time (UTC) from which the Discount is effective. Take Eventual Consistency into account for calculated discount values.
- Returns:
- validFrom
-
getValidUntil
Date and time (UTC) until which the Discount is effective. Take Eventual Consistency into account for calculated undiscounted values.
- Returns:
- validUntil
-
build
builds ProductDiscount with checking for non-null required values- Specified by:
build
in interfaceBuilder<ProductDiscount>
- Returns:
- ProductDiscount
-
buildUnchecked
builds ProductDiscount without checking for non-null required values- Returns:
- ProductDiscount
-
of
factory method for an instance of ProductDiscountBuilder- Returns:
- builder
-
of
create builder for ProductDiscount instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-