Interface ShippingMethodDraft
- All Superinterfaces:
CustomizableDraft<ShippingMethodDraft>,Draft<ShippingMethodDraft>,WithKey
Example to create an instance using the builder pattern
ShippingMethodDraft shippingMethodDraft = ShippingMethodDraft.builder()
.name("{name}")
.taxCategory(taxCategoryBuilder -> taxCategoryBuilder)
.plusZoneRates(zoneRatesBuilder -> zoneRatesBuilder)
.isDefault(true)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ShippingMethodDraftBuilderbuilder()builder factory method for ShippingMethodDraftstatic ShippingMethodDraftBuilderbuilder(ShippingMethodDraft template) create builder for ShippingMethodDraft instancecopyDeep()static ShippingMethodDraftdeepCopy(ShippingMethodDraft template) factory method to create a deep copy of ShippingMethodDraftWhether the ShippingMethod can be used during the creation or update of a Cart or Order.Name of the carrier that delivers the parcel, for exampleDHL.@Valid CustomFieldsDraftCustom Fields for the ShippingMethod.Deprecated.@NotNull BooleanWhether the ShippingMethod will be the Project's default ShippingMethod.getKey()User-defined unique identifier for the ShippingMethod.@Valid LocalizedStringLocalized description of the ShippingMethod.@Valid LocalizedStringLocalized name of the ShippingMethod.@NotNull StringgetName()Unique name for the ShippingMethod within a Project.Valid Cart predicate to select a ShippingMethod for a Cart.@Valid List<StoreResourceIdentifier>@NotNull @Valid TaxCategoryResourceIdentifierTaxCategory for all ZoneRates of the ShippingMethod.@NotNull @Valid List<ZoneRateDraft>Defines ShippingRates (prices) for specific zones.static ShippingMethodDraftof()factory methodstatic ShippingMethodDraftof(ShippingMethodDraft template) factory method to create a shallow copy ShippingMethodDraftvoidWhether the ShippingMethod can be used during the creation or update of a Cart or Order.voidsetCarrier(String carrier) Name of the carrier that delivers the parcel, for exampleDHL.voidsetCustom(CustomFieldsDraft custom) Custom Fields for the ShippingMethod.voidsetDescription(String description) Deprecated.voidsetIsDefault(Boolean isDefault) Whether the ShippingMethod will be the Project's default ShippingMethod.voidUser-defined unique identifier for the ShippingMethod.voidsetLocalizedDescription(LocalizedString localizedDescription) Localized description of the ShippingMethod.voidsetLocalizedName(LocalizedString localizedName) Localized name of the ShippingMethod.voidUnique name for the ShippingMethod within a Project.voidsetPredicate(String predicate) Valid Cart predicate to select a ShippingMethod for a Cart.voidsetStores(StoreResourceIdentifier... stores) voidsetStores(List<StoreResourceIdentifier> stores) voidsetTaxCategory(TaxCategoryResourceIdentifier taxCategory) TaxCategory for all ZoneRates of the ShippingMethod.voidsetZoneRates(ZoneRateDraft... zoneRates) Defines ShippingRates (prices) for specific zones.voidsetZoneRates(List<ZoneRateDraft> zoneRates) Defines ShippingRates (prices) for specific zones.static tools.jackson.core.type.TypeReference<ShippingMethodDraft>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithShippingMethodDraft(Function<ShippingMethodDraft, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.CustomizableDraft
unwrapCustomizableDraft
-
Method Details
-
getKey
String getKey()User-defined unique identifier for the ShippingMethod.
-
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
Boolean getActive()Whether the ShippingMethod can be used during the creation or update of a Cart or Order.
- Returns:
- active
-
getIsDefault
Whether the ShippingMethod will be the Project's default ShippingMethod. When retrieving matching Shipping Methods, it is returned as the first item in the array. This flag does not automatically apply the Shipping Method to Carts.
- Returns:
- isDefault
-
getPredicate
String getPredicate()Valid Cart predicate to select a ShippingMethod for a Cart.
- Returns:
- predicate
-
getCustom
Custom Fields for the ShippingMethod.
- Specified by:
getCustomin interfaceCustomizableDraft<ShippingMethodDraft>- Returns:
- custom
-
getStores
- If defined and not empty, the Shipping Method applies to Carts with a Store that matches any Store in this field.
- If not defined or empty, the Shipping Method applies to all Carts, irrespective of a Store.
If the number of referenced Stores exceeds the Stores per Shipping Method limit, an InvalidOperation error is returned.
- Returns:
- stores
-
getCarrier
String getCarrier()Name of the carrier that delivers the parcel, for example
DHL.- Returns:
- carrier
-
setKey
User-defined unique identifier for the ShippingMethod.
- Parameters:
key- value to be set
-
setName
Unique name for the ShippingMethod within a Project.
- Parameters:
name- value to be set
-
setLocalizedName
Localized name of the ShippingMethod.
- Parameters:
localizedName- value to be set
-
setDescription
Deprecated.Description of the ShippingMethod.
- Parameters:
description- value to be set
-
setLocalizedDescription
Localized description of the ShippingMethod.
- Parameters:
localizedDescription- value to be set
-
setTaxCategory
TaxCategory for all ZoneRates of the ShippingMethod.
- Parameters:
taxCategory- value to be set
-
setZoneRates
Defines ShippingRates (prices) for specific zones.
- Parameters:
zoneRates- values to be set
-
setZoneRates
Defines ShippingRates (prices) for specific zones.
- Parameters:
zoneRates- values to be set
-
setActive
Whether the ShippingMethod can be used during the creation or update of a Cart or Order.
- Parameters:
active- value to be set
-
setIsDefault
Whether the ShippingMethod will be the Project's default ShippingMethod. When retrieving matching Shipping Methods, it is returned as the first item in the array. This flag does not automatically apply the Shipping Method to Carts.
- Parameters:
isDefault- value to be set
-
setPredicate
Valid Cart predicate to select a ShippingMethod for a Cart.
- Parameters:
predicate- value to be set
-
setCustom
Custom Fields for the ShippingMethod.
- Specified by:
setCustomin interfaceCustomizableDraft<ShippingMethodDraft>- Parameters:
custom- value to be set
-
setStores
- If defined and not empty, the Shipping Method applies to Carts with a Store that matches any Store in this field.
- If not defined or empty, the Shipping Method applies to all Carts, irrespective of a Store.
If the number of referenced Stores exceeds the Stores per Shipping Method limit, an InvalidOperation error is returned.
- Parameters:
stores- values to be set
-
setStores
- If defined and not empty, the Shipping Method applies to Carts with a Store that matches any Store in this field.
- If not defined or empty, the Shipping Method applies to all Carts, irrespective of a Store.
If the number of referenced Stores exceeds the Stores per Shipping Method limit, an InvalidOperation error is returned.
- Parameters:
stores- values to be set
-
setCarrier
Name of the carrier that delivers the parcel, for example
DHL.- Parameters:
carrier- value to be set
-
of
factory method- Returns:
- instance of ShippingMethodDraft
-
of
factory method to create a shallow copy ShippingMethodDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
ShippingMethodDraft copyDeep() -
deepCopy
factory method to create a deep copy of ShippingMethodDraft- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ShippingMethodDraft- Returns:
- builder
-
builder
create builder for ShippingMethodDraft instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withShippingMethodDraft
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-