Class DiscountGroupDraftBuilder
- All Implemented Interfaces:
Builder<DiscountGroupDraft>
Example to create an instance using the builder pattern
DiscountGroupDraft discountGroupDraft = DiscountGroupDraft.builder()
.key("{key}")
.sortOrder("{sortOrder}")
.build()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds DiscountGroupDraft with checking for non-null required valuesbuilds DiscountGroupDraft without checking for non-null required valuesdescription
(LocalizedString description) Description for the DiscountGroup.Description for the DiscountGroup.Description for the DiscountGroup.getKey()
User-defined unique identifier for the DiscountGroup.getName()
Name of the DiscountGroup.Value between0
and1
that determines the order in which the CartDiscount from the DiscountGroup will be applied; a CartDiscount with a higher value will be prioritized.User-defined unique identifier for the DiscountGroup.name
(LocalizedString name) Name of the DiscountGroup.Name of the DiscountGroup.static DiscountGroupDraftBuilder
of()
factory method for an instance of DiscountGroupDraftBuilderstatic DiscountGroupDraftBuilder
of
(DiscountGroupDraft template) create builder for DiscountGroupDraft instanceValue between0
and1
that determines the order in which the CartDiscount from the DiscountGroup will be applied; a CartDiscount with a higher value will be prioritized.Description for the DiscountGroup.Name of the DiscountGroup.
-
Constructor Details
-
DiscountGroupDraftBuilder
public DiscountGroupDraftBuilder()
-
-
Method Details
-
name
public DiscountGroupDraftBuilder name(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Name of the DiscountGroup.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
withName
Name of the DiscountGroup.
- Parameters:
builder
- function to build the name value- Returns:
- Builder
-
name
Name of the DiscountGroup.
- Parameters:
name
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier for the DiscountGroup.
- Parameters:
key
- value to be set- Returns:
- Builder
-
description
public DiscountGroupDraftBuilder description(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Description for the DiscountGroup.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
withDescription
public DiscountGroupDraftBuilder withDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Description for the DiscountGroup.
- Parameters:
builder
- function to build the description value- Returns:
- Builder
-
description
Description for the DiscountGroup.
- Parameters:
description
- value to be set- Returns:
- Builder
-
sortOrder
Value between
0
and1
that determines the order in which the CartDiscount from the DiscountGroup will be applied; a CartDiscount with a higher value will be prioritized.The sort order must be unique among all DiscountGroups and CartDiscounts.
- Parameters:
sortOrder
- value to be set- Returns:
- Builder
-
getName
Name of the DiscountGroup.
- Returns:
- name
-
getKey
User-defined unique identifier for the DiscountGroup.
- Returns:
- key
-
getDescription
Description for the DiscountGroup.
- Returns:
- description
-
getSortOrder
Value between
0
and1
that determines the order in which the CartDiscount from the DiscountGroup will be applied; a CartDiscount with a higher value will be prioritized.The sort order must be unique among all DiscountGroups and CartDiscounts.
- Returns:
- sortOrder
-
build
builds DiscountGroupDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<DiscountGroupDraft>
- Returns:
- DiscountGroupDraft
-
buildUnchecked
builds DiscountGroupDraft without checking for non-null required values- Returns:
- DiscountGroupDraft
-
of
factory method for an instance of DiscountGroupDraftBuilder- Returns:
- builder
-
of
create builder for DiscountGroupDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-