Class ShippingMethodBuilder
- All Implemented Interfaces:
Builder<ShippingMethod>
Example to create an instance using the builder pattern
ShippingMethod shippingMethod = ShippingMethod.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("{name}")
.taxCategory(taxCategoryBuilder -> taxCategoryBuilder)
.plusZoneRates(zoneRatesBuilder -> zoneRatesBuilder)
.active(true)
.isDefault(true)
.build()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIndicates if the ShippingMethod is active.addZoneRates
(Function<ZoneRateBuilder, ZoneRate> builder) Defines ShippingRates (prices) for specific Zones.build()
builds ShippingMethod with checking for non-null required valuesbuilds ShippingMethod without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the ShippingMethod was initially created.IDs and references that created the ShippingMethod.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the ShippingMethod.custom
(CustomFields custom) Custom Fields of the ShippingMethod.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields of the ShippingMethod.description
(String description) Deprecated.Indicates if the ShippingMethod is active.Date and time (UTC) the ShippingMethod was initially created.IDs and references that created the ShippingMethod.Custom Fields of the ShippingMethod.Deprecated.getId()
Unique identifier of the ShippingMethod.Iftrue
, this ShippingMethod is the Project's default ShippingMethod.getKey()
User-defined unique identifier of the ShippingMethod.Date and time (UTC) the ShippingMethod was last updated.IDs and references that last modified the ShippingMethod.Localized description of the ShippingMethod.Localized name of the ShippingMethod.getName()
Unique name of the ShippingMethod within a Project.Valid Cart predicate to select a ShippingMethod for a Cart.TaxCategory of all ZoneRates of the ShippingMethod.Current version of the ShippingMethod.Defines ShippingRates (prices) for specific Zones.Unique identifier of the ShippingMethod.Iftrue
, this ShippingMethod is the Project's default ShippingMethod.User-defined unique identifier of the ShippingMethod.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the ShippingMethod was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the ShippingMethod.IDs and references that last modified 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 of the ShippingMethod within a Project.static ShippingMethodBuilder
of()
factory method for an instance of ShippingMethodBuilderstatic ShippingMethodBuilder
of
(ShippingMethod template) create builder for ShippingMethod instanceplusZoneRates
(ZoneRate... zoneRates) Defines ShippingRates (prices) for specific Zones.plusZoneRates
(Function<ZoneRateBuilder, ZoneRateBuilder> builder) Defines ShippingRates (prices) for specific Zones.Valid Cart predicate to select a ShippingMethod for a Cart.setZoneRates
(Function<ZoneRateBuilder, ZoneRate> builder) Defines ShippingRates (prices) for specific Zones.taxCategory
(TaxCategoryReference taxCategory) TaxCategory of all ZoneRates of the ShippingMethod.TaxCategory of all ZoneRates of the ShippingMethod.Current version of the ShippingMethod.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the ShippingMethod.withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields of the ShippingMethod.IDs and references that last modified the ShippingMethod.Localized description of the ShippingMethod.Localized name of the ShippingMethod.TaxCategory of all ZoneRates of the ShippingMethod.withZoneRates
(Function<ZoneRateBuilder, ZoneRateBuilder> builder) Defines ShippingRates (prices) for specific Zones.Defines ShippingRates (prices) for specific Zones.Defines ShippingRates (prices) for specific Zones.
-
Constructor Details
-
ShippingMethodBuilder
public ShippingMethodBuilder()
-
-
Method Details
-
id
Unique identifier of the ShippingMethod.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the ShippingMethod.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the ShippingMethod was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the ShippingMethod was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
lastModifiedBy
public ShippingMethodBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the ShippingMethod.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
public ShippingMethodBuilder withLastModifiedBy(Function<LastModifiedByBuilder, LastModifiedBy> builder) IDs and references that last modified the ShippingMethod.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the ShippingMethod.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the ShippingMethod.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the ShippingMethod.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the ShippingMethod.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
key
User-defined unique identifier of the ShippingMethod.
- Parameters:
key
- value to be set- Returns:
- Builder
-
name
Unique name of the ShippingMethod within a Project.
- Parameters:
name
- value to be set- Returns:
- Builder
-
localizedName
public ShippingMethodBuilder localizedName(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Localized name of the ShippingMethod.
- Parameters:
builder
- function to build the localizedName value- Returns:
- Builder
-
withLocalizedName
public ShippingMethodBuilder 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 ShippingMethodBuilder localizedDescription(Function<LocalizedStringBuilder, LocalizedStringBuilder> builder) Localized description of the ShippingMethod.
- Parameters:
builder
- function to build the localizedDescription value- Returns:
- Builder
-
withLocalizedDescription
public ShippingMethodBuilder withLocalizedDescription(Function<LocalizedStringBuilder, LocalizedString> builder) Localized description of the ShippingMethod.
- Parameters:
builder
- function to build the localizedDescription value- Returns:
- Builder
-
localizedDescription
Localized description of the ShippingMethod.
- Parameters:
localizedDescription
- value to be set- Returns:
- Builder
-
taxCategory
public ShippingMethodBuilder taxCategory(Function<TaxCategoryReferenceBuilder, TaxCategoryReferenceBuilder> builder) TaxCategory of all ZoneRates of the ShippingMethod.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
withTaxCategory
public ShippingMethodBuilder withTaxCategory(Function<TaxCategoryReferenceBuilder, TaxCategoryReference> builder) TaxCategory of all ZoneRates of the ShippingMethod.
- Parameters:
builder
- function to build the taxCategory value- Returns:
- Builder
-
taxCategory
TaxCategory of 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
Defines ShippingRates (prices) for specific Zones.
- Parameters:
builder
- function to build the zoneRates value- Returns:
- Builder
-
withZoneRates
Defines ShippingRates (prices) for specific Zones.
- Parameters:
builder
- function to build the zoneRates value- Returns:
- Builder
-
addZoneRates
Defines ShippingRates (prices) for specific Zones.
- Parameters:
builder
- function to build the zoneRates value- Returns:
- Builder
-
setZoneRates
Defines ShippingRates (prices) for specific Zones.
- Parameters:
builder
- function to build the zoneRates value- Returns:
- Builder
-
active
Indicates if the ShippingMethod is active.
If
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
true
, this ShippingMethod is 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
Custom Fields of the ShippingMethod.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields of the ShippingMethod.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields of the ShippingMethod.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the ShippingMethod.
- Returns:
- id
-
getVersion
Current version of the ShippingMethod.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the ShippingMethod was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the ShippingMethod was last updated.
- Returns:
- lastModifiedAt
-
getLastModifiedBy
IDs and references that last modified the ShippingMethod.
- Returns:
- lastModifiedBy
-
getCreatedBy
IDs and references that created the ShippingMethod.
- Returns:
- createdBy
-
getKey
User-defined unique identifier of the ShippingMethod.
- Returns:
- key
-
getName
Unique name of 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 of all ZoneRates of the ShippingMethod.
- Returns:
- taxCategory
-
getZoneRates
Defines ShippingRates (prices) for specific Zones.
- Returns:
- zoneRates
-
getActive
Indicates if the ShippingMethod is active.
If
true
, the ShippingMethod can be used during the creation or update of a Cart or Order.- Returns:
- active
-
getIsDefault
If
true
, this ShippingMethod is the Project's default ShippingMethod.- Returns:
- isDefault
-
getPredicate
Valid Cart predicate to select a ShippingMethod for a Cart.
- Returns:
- predicate
-
getCustom
Custom Fields of the ShippingMethod.
- Returns:
- custom
-
build
builds ShippingMethod with checking for non-null required values- Specified by:
build
in interfaceBuilder<ShippingMethod>
- Returns:
- ShippingMethod
-
buildUnchecked
builds ShippingMethod without checking for non-null required values- Returns:
- ShippingMethod
-
of
factory method for an instance of ShippingMethodBuilder- Returns:
- builder
-
of
create builder for ShippingMethod instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-