Class ShippingMethodDraftBuilder
- All Implemented Interfaces:
Builder<ShippingMethodDraft>
Example to create an instance using the builder pattern
ShippingMethodDraft shippingMethodDraft = ShippingMethodDraft.builder()
.name("{name}")
.taxCategory(taxCategoryBuilder -> taxCategoryBuilder)
.plusZoneRates(zoneRatesBuilder -> zoneRatesBuilder)
.isDefault(true)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIf set totrue
, the ShippingMethod can be used during the creation or update of a Cart or Order.Defines ShippingRates (prices) for specific zones.build()
builds ShippingMethodDraft with checking for non-null required valuesbuilds ShippingMethodDraft without checking for non-null required valuescustom
(CustomFieldsDraft custom) Custom Fields for the ShippingMethod.Custom Fields for the ShippingMethod.description
(String description) Deprecated.If set totrue
, the ShippingMethod can be used during the creation or update of a Cart or Order.Custom Fields for the ShippingMethod.Deprecated.If set totrue
, the ShippingMethod will be the Project's default ShippingMethod.getKey()
User-defined unique identifier for the ShippingMethod.Localized description of the ShippingMethod.Localized name of the ShippingMethod.getName()
Unique name for the ShippingMethod within a Project.Valid Cart predicate to select a ShippingMethod for a Cart.TaxCategory for all ZoneRates of the ShippingMethod.Defines ShippingRates (prices) for specific zones.If set totrue
, the ShippingMethod will be the Project's default ShippingMethod.User-defined unique identifier for the ShippingMethod.localizedDescription
(LocalizedString localizedDescription) Localized description of the ShippingMethod.Localized description of the ShippingMethod.localizedName
(LocalizedString localizedName) Localized name of the ShippingMethod.Localized name of the ShippingMethod.Unique name for the ShippingMethod within a Project.static ShippingMethodDraftBuilder
of()
factory method for an instance of ShippingMethodDraftBuilderstatic ShippingMethodDraftBuilder
of
(ShippingMethodDraft template) create builder for ShippingMethodDraft instanceplusZoneRates
(ZoneRateDraft... zoneRates) Defines ShippingRates (prices) for specific zones.Defines ShippingRates (prices) for specific zones.Valid Cart predicate to select a ShippingMethod for a Cart.Defines ShippingRates (prices) for specific zones.taxCategory
(TaxCategoryResourceIdentifier taxCategory) TaxCategory for all ZoneRates of the ShippingMethod.taxCategory
(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifierBuilder> builder) TaxCategory for all ZoneRates of the ShippingMethod.Custom Fields for the ShippingMethod.Localized description of the ShippingMethod.Localized name of the ShippingMethod.withTaxCategory
(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifier> builder) TaxCategory for all ZoneRates of the ShippingMethod.Defines ShippingRates (prices) for specific zones.zoneRates
(ZoneRateDraft... zoneRates) Defines ShippingRates (prices) for specific zones.zoneRates
(List<ZoneRateDraft> zoneRates) Defines ShippingRates (prices) for specific zones.
-
Constructor Details
-
ShippingMethodDraftBuilder
public ShippingMethodDraftBuilder()
-
-
Method Details
-
key
User-defined unique identifier for the ShippingMethod.
- Parameters:
key
- value to be set- Returns:
- Builder
-
name
Unique name for the ShippingMethod within a Project.
- Parameters:
name
- value to be set- Returns:
- Builder
-
localizedName
public ShippingMethodDraftBuilder localizedName(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Localized name of the ShippingMethod.
- Parameters:
builder
- function to build the localizedName value- Returns:
- Builder
-
withLocalizedName
public ShippingMethodDraftBuilder withLocalizedName(Function<LocalizedStringBuilder, LocalizedString> builder) Localized name of the ShippingMethod.
- Parameters:
builder
- function to build the localizedName value- Returns:
- Builder
-
localizedName
Localized name of the ShippingMethod.
- Parameters:
localizedName
- value to be set- Returns:
- Builder
-
description
Deprecated.Description of the ShippingMethod.
- Parameters:
description
- value to be set- Returns:
- Builder
-
localizedDescription
public ShippingMethodDraftBuilder localizedDescription(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Localized description of the ShippingMethod.
- Parameters:
builder
- function to build the localizedDescription value- Returns:
- Builder
-
withLocalizedDescription
public ShippingMethodDraftBuilder withLocalizedDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Localized description of the ShippingMethod.
- Parameters:
builder
- function to build the localizedDescription value- Returns:
- Builder
-
localizedDescription
public ShippingMethodDraftBuilder localizedDescription(@Nullable LocalizedString localizedDescription) Localized description of the ShippingMethod.
- Parameters:
localizedDescription
- value to be set- Returns:
- Builder
-
taxCategory
public ShippingMethodDraftBuilder taxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifierBuilder> builder) TaxCategory for all ZoneRates of the ShippingMethod.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public ShippingMethodDraftBuilder withTaxCategory(Function<TaxCategoryResourceIdentifierBuilder, TaxCategoryResourceIdentifier> builder) TaxCategory for all ZoneRates of the ShippingMethod.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
taxCategory
TaxCategory for all ZoneRates of the ShippingMethod.
- Parameters:
taxCategory
- value to be set- Returns:
- Builder
-
zoneRates
Defines ShippingRates (prices) for specific zones.
- Parameters:
zoneRates
- value to be set- Returns:
- Builder
-
zoneRates
Defines ShippingRates (prices) for specific zones.
- Parameters:
zoneRates
- value to be set- Returns:
- Builder
-
plusZoneRates
Defines ShippingRates (prices) for specific zones.
- Parameters:
zoneRates
- value to be set- Returns:
- Builder
-
plusZoneRates
public ShippingMethodDraftBuilder plusZoneRates(Function<ZoneRateDraftBuilder, ZoneRateDraftBuilder> builder) Defines ShippingRates (prices) for specific zones.
- Parameters:
builder
- function to build the zoneRates value- Returns:
- Builder
-
withZoneRates
public ShippingMethodDraftBuilder withZoneRates(Function<ZoneRateDraftBuilder, ZoneRateDraftBuilder> builder) Defines ShippingRates (prices) for specific zones.
- Parameters:
builder
- function to build the zoneRates value- Returns:
- Builder
-
addZoneRates
public ShippingMethodDraftBuilder addZoneRates(Function<ZoneRateDraftBuilder, ZoneRateDraft> builder) Defines ShippingRates (prices) for specific zones.
- Parameters:
builder
- function to build the zoneRates value- Returns:
- Builder
-
setZoneRates
public ShippingMethodDraftBuilder setZoneRates(Function<ZoneRateDraftBuilder, ZoneRateDraft> builder) Defines ShippingRates (prices) for specific zones.
- Parameters:
builder
- function to build the zoneRates value- Returns:
- Builder
-
active
If set to
true
, the ShippingMethod can be used during the creation or update of a Cart or Order.- Parameters:
active
- value to be set- Returns:
- Builder
-
isDefault
If set to
true
, the ShippingMethod will be the Project's default ShippingMethod.- Parameters:
isDefault
- value to be set- Returns:
- Builder
-
predicate
Valid Cart predicate to select a ShippingMethod for a Cart.
- Parameters:
predicate
- value to be set- Returns:
- Builder
-
custom
public ShippingMethodDraftBuilder custom(Function<CustomFieldsDraftBuilder, CustomFieldsDraftBuilder> builder) Custom Fields for the ShippingMethod.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
public ShippingMethodDraftBuilder withCustom(Function<CustomFieldsDraftBuilder, CustomFieldsDraft> builder) Custom Fields for the ShippingMethod.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields for the ShippingMethod.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getKey
User-defined unique identifier for the ShippingMethod.
- Returns:
- key
-
getName
Unique name for the ShippingMethod within a Project.
- Returns:
- name
-
getLocalizedName
Localized name of the ShippingMethod.
- Returns:
- localizedName
-
getDescription
Deprecated.Description of the ShippingMethod.
- Returns:
- description
-
getLocalizedDescription
Localized description of the ShippingMethod.
- Returns:
- localizedDescription
-
getTaxCategory
TaxCategory for all ZoneRates of the ShippingMethod.
- Returns:
- taxCategory
-
getZoneRates
Defines ShippingRates (prices) for specific zones.
- Returns:
- zoneRates
-
getActive
If set to
true
, the ShippingMethod can be used during the creation or update of a Cart or Order.- Returns:
- active
-
getIsDefault
If set to
true
, the ShippingMethod will be the Project's default ShippingMethod.- Returns:
- isDefault
-
getPredicate
Valid Cart predicate to select a ShippingMethod for a Cart.
- Returns:
- predicate
-
getCustom
Custom Fields for the ShippingMethod.
- Returns:
- custom
-
build
builds ShippingMethodDraft with checking for non-null required values- Specified by:
build
in interfaceBuilder<ShippingMethodDraft>
- Returns:
- ShippingMethodDraft
-
buildUnchecked
builds ShippingMethodDraft without checking for non-null required values- Returns:
- ShippingMethodDraft
-
of
factory method for an instance of ShippingMethodDraftBuilder- Returns:
- builder
-
of
create builder for ShippingMethodDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-