Class DiscountCodeImportBuilder
- All Implemented Interfaces:
Builder<DiscountCodeImport>
Example to create an instance using the builder pattern
DiscountCodeImport discountCodeImport = DiscountCodeImport.builder()
.key("{key}")
.code("{code}")
.plusCartDiscounts(cartDiscountsBuilder -> cartDiscountsBuilder)
.isActive(true)
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMaps toDiscountCode.cartDiscounts.build()builds DiscountCodeImport with checking for non-null required valuesbuilds DiscountCodeImport without checking for non-null required valuescartDiscounts(CartDiscountKeyReference... cartDiscounts) Maps toDiscountCode.cartDiscounts.cartDiscounts(List<CartDiscountKeyReference> cartDiscounts) Maps toDiscountCode.cartDiscounts.cartPredicate(String cartPredicate) Maps toDiscountCode.cartPredicate.Maps toDiscountCode.code.Maps toDiscountCode.custom.custom(Function<CustomBuilder, CustomBuilder> builder) Maps toDiscountCode.custom.description(LocalizedString description) Maps toDiscountCode.description.Maps toDiscountCode.description.Maps toDiscountCode.cartDiscounts.Maps toDiscountCode.cartPredicate.getCode()Maps toDiscountCode.code.Maps toDiscountCode.custom.Maps toDiscountCode.description.Maps toDiscountCode.groups.Maps toDiscountCode.isActive.getKey()User-defined unique identifier.Maps toDiscountCode.maxApplications.Maps toDiscountCode.maxApplicationsPerCustomer.getName()Maps toDiscountCode.name.Maps toDiscountCode.validFrom.Maps toDiscountCode.validUntil.Maps toDiscountCode.groups.Maps toDiscountCode.groups.Maps toDiscountCode.isActive.User-defined unique identifier.maxApplications(Long maxApplications) Maps toDiscountCode.maxApplications.maxApplicationsPerCustomer(Long maxApplicationsPerCustomer) Maps toDiscountCode.maxApplicationsPerCustomer.name(LocalizedString name) Maps toDiscountCode.name.Maps toDiscountCode.name.static DiscountCodeImportBuilderof()factory method for an instance of DiscountCodeImportBuilderstatic DiscountCodeImportBuilderof(DiscountCodeImport template) create builder for DiscountCodeImport instanceplusCartDiscounts(CartDiscountKeyReference... cartDiscounts) Maps toDiscountCode.cartDiscounts.plusCartDiscounts(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReferenceBuilder> builder) Maps toDiscountCode.cartDiscounts.plusGroups(String... groups) Maps toDiscountCode.groups.Maps toDiscountCode.cartDiscounts.validFrom(ZonedDateTime validFrom) Maps toDiscountCode.validFrom.validUntil(ZonedDateTime validUntil) Maps toDiscountCode.validUntil.withCartDiscounts(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReferenceBuilder> builder) Maps toDiscountCode.cartDiscounts.withCustom(Function<CustomBuilder, Custom> builder) Maps toDiscountCode.custom.Maps toDiscountCode.description.Maps toDiscountCode.name.
-
Constructor Details
-
DiscountCodeImportBuilder
public DiscountCodeImportBuilder()
-
-
Method Details
-
key
User-defined unique identifier. If a DiscountCode with this
keyexists, it is updated with the imported data.- Parameters:
key- value to be set- Returns:
- Builder
-
name
public DiscountCodeImportBuilder name(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Maps to
DiscountCode.name.- Parameters:
builder- function to build the name value- Returns:
- Builder
-
withName
Maps to
DiscountCode.name.- Parameters:
builder- function to build the name value- Returns:
- Builder
-
name
Maps to
DiscountCode.name.- Parameters:
name- value to be set- Returns:
- Builder
-
description
public DiscountCodeImportBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Maps to
DiscountCode.description.- Parameters:
builder- function to build the description value- Returns:
- Builder
-
withDescription
public DiscountCodeImportBuilder withDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Maps to
DiscountCode.description.- Parameters:
builder- function to build the description value- Returns:
- Builder
-
description
Maps to
DiscountCode.description.- Parameters:
description- value to be set- Returns:
- Builder
-
code
Maps to
DiscountCode.code. This value cannot be updated. Attempting to update this value will result in an InvalidFieldsUpdate error.- Parameters:
code- value to be set- Returns:
- Builder
-
cartDiscounts
Maps to
DiscountCode.cartDiscounts. If the referenced CartDiscounts do not exist, thestateof the ImportOperation will be set tounresolveduntil the referenced CartDiscounts are created.- Parameters:
cartDiscounts- value to be set- Returns:
- Builder
-
cartDiscounts
Maps to
DiscountCode.cartDiscounts. If the referenced CartDiscounts do not exist, thestateof the ImportOperation will be set tounresolveduntil the referenced CartDiscounts are created.- Parameters:
cartDiscounts- value to be set- Returns:
- Builder
-
plusCartDiscounts
Maps to
DiscountCode.cartDiscounts. If the referenced CartDiscounts do not exist, thestateof the ImportOperation will be set tounresolveduntil the referenced CartDiscounts are created.- Parameters:
cartDiscounts- value to be set- Returns:
- Builder
-
plusCartDiscounts
public DiscountCodeImportBuilder plusCartDiscounts(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReferenceBuilder> builder) Maps to
DiscountCode.cartDiscounts. If the referenced CartDiscounts do not exist, thestateof the ImportOperation will be set tounresolveduntil the referenced CartDiscounts are created.- Parameters:
builder- function to build the cartDiscounts value- Returns:
- Builder
-
withCartDiscounts
public DiscountCodeImportBuilder withCartDiscounts(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReferenceBuilder> builder) Maps to
DiscountCode.cartDiscounts. If the referenced CartDiscounts do not exist, thestateof the ImportOperation will be set tounresolveduntil the referenced CartDiscounts are created.- Parameters:
builder- function to build the cartDiscounts value- Returns:
- Builder
-
addCartDiscounts
public DiscountCodeImportBuilder addCartDiscounts(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReference> builder) Maps to
DiscountCode.cartDiscounts. If the referenced CartDiscounts do not exist, thestateof the ImportOperation will be set tounresolveduntil the referenced CartDiscounts are created.- Parameters:
builder- function to build the cartDiscounts value- Returns:
- Builder
-
setCartDiscounts
public DiscountCodeImportBuilder setCartDiscounts(Function<CartDiscountKeyReferenceBuilder, CartDiscountKeyReference> builder) Maps to
DiscountCode.cartDiscounts. If the referenced CartDiscounts do not exist, thestateof the ImportOperation will be set tounresolveduntil the referenced CartDiscounts are created.- Parameters:
builder- function to build the cartDiscounts value- Returns:
- Builder
-
cartPredicate
Maps to
DiscountCode.cartPredicate.- Parameters:
cartPredicate- value to be set- Returns:
- Builder
-
isActive
Maps to
DiscountCode.isActive.- Parameters:
isActive- value to be set- Returns:
- Builder
-
maxApplications
Maps to
DiscountCode.maxApplications.- Parameters:
maxApplications- value to be set- Returns:
- Builder
-
maxApplicationsPerCustomer
public DiscountCodeImportBuilder maxApplicationsPerCustomer(@Nullable Long maxApplicationsPerCustomer) Maps to
DiscountCode.maxApplicationsPerCustomer.- Parameters:
maxApplicationsPerCustomer- value to be set- Returns:
- Builder
-
groups
Maps to
DiscountCode.groups.- Parameters:
groups- value to be set- Returns:
- Builder
-
groups
Maps to
DiscountCode.groups.- Parameters:
groups- value to be set- Returns:
- Builder
-
plusGroups
Maps to
DiscountCode.groups.- Parameters:
groups- value to be set- Returns:
- Builder
-
validFrom
Maps to
DiscountCode.validFrom.- Parameters:
validFrom- value to be set- Returns:
- Builder
-
validUntil
Maps to
DiscountCode.validUntil.- Parameters:
validUntil- value to be set- Returns:
- Builder
-
custom
Maps to
DiscountCode.custom.- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
withCustom
Maps to
DiscountCode.custom.- Parameters:
builder- function to build the custom value- Returns:
- Builder
-
custom
Maps to
DiscountCode.custom.- Parameters:
custom- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier. If a DiscountCode with this
keyexists, it is updated with the imported data.- Returns:
- key
-
getName
Maps to
DiscountCode.name.- Returns:
- name
-
getDescription
Maps to
DiscountCode.description.- Returns:
- description
-
getCode
Maps to
DiscountCode.code. This value cannot be updated. Attempting to update this value will result in an InvalidFieldsUpdate error.- Returns:
- code
-
getCartDiscounts
Maps to
DiscountCode.cartDiscounts. If the referenced CartDiscounts do not exist, thestateof the ImportOperation will be set tounresolveduntil the referenced CartDiscounts are created.- Returns:
- cartDiscounts
-
getCartPredicate
Maps to
DiscountCode.cartPredicate.- Returns:
- cartPredicate
-
getIsActive
Maps to
DiscountCode.isActive.- Returns:
- isActive
-
getMaxApplications
Maps to
DiscountCode.maxApplications.- Returns:
- maxApplications
-
getMaxApplicationsPerCustomer
Maps to
DiscountCode.maxApplicationsPerCustomer.- Returns:
- maxApplicationsPerCustomer
-
getGroups
Maps to
DiscountCode.groups.- Returns:
- groups
-
getValidFrom
Maps to
DiscountCode.validFrom.- Returns:
- validFrom
-
getValidUntil
Maps to
DiscountCode.validUntil.- Returns:
- validUntil
-
getCustom
Maps to
DiscountCode.custom.- Returns:
- custom
-
build
builds DiscountCodeImport with checking for non-null required values- Specified by:
buildin interfaceBuilder<DiscountCodeImport>- Returns:
- DiscountCodeImport
-
buildUnchecked
builds DiscountCodeImport without checking for non-null required values- Returns:
- DiscountCodeImport
-
of
factory method for an instance of DiscountCodeImportBuilder- Returns:
- builder
-
of
create builder for DiscountCodeImport instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-