Interface ShippingMethodDraft

All Superinterfaces:
CustomizableDraft<ShippingMethodDraft>, Draft<ShippingMethodDraft>, WithKey

public interface ShippingMethodDraft extends CustomizableDraft<ShippingMethodDraft>, WithKey, Draft<ShippingMethodDraft>
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()
 
  • Method Details

    • getKey

      String getKey()

      User-defined unique identifier for the ShippingMethod.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getName

      @NotNull @NotNull String getName()

      Unique name for the ShippingMethod within a Project.

      Returns:
      name
    • getLocalizedName

      @Valid @Valid LocalizedString getLocalizedName()

      Localized name of the ShippingMethod.

      Returns:
      localizedName
    • getDescription

      @Deprecated String getDescription()
      Deprecated.

      Description of the ShippingMethod.

      Returns:
      description
    • getLocalizedDescription

      @Valid @Valid LocalizedString getLocalizedDescription()

      Localized description of the ShippingMethod.

      Returns:
      localizedDescription
    • getTaxCategory

      @NotNull @Valid @NotNull @Valid TaxCategoryResourceIdentifier getTaxCategory()

      TaxCategory for all ZoneRates of the ShippingMethod.

      Returns:
      taxCategory
    • getZoneRates

      @NotNull @Valid @NotNull @Valid List<ZoneRateDraft> getZoneRates()

      Defines ShippingRates (prices) for specific zones.

      Returns:
      zoneRates
    • getIsDefault

      @NotNull @NotNull Boolean getIsDefault()

      If true the ShippingMethod will be the Project's default ShippingMethod.

      Returns:
      isDefault
    • getPredicate

      String getPredicate()

      Valid Cart predicate to select a ShippingMethod for a Cart.

      Returns:
      predicate
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields for the ShippingMethod.

      Specified by:
      getCustom in interface CustomizableDraft<ShippingMethodDraft>
      Returns:
      custom
    • setKey

      void setKey(String key)

      User-defined unique identifier for the ShippingMethod.

      Parameters:
      key - value to be set
    • setName

      void setName(String name)

      Unique name for the ShippingMethod within a Project.

      Parameters:
      name - value to be set
    • setLocalizedName

      void setLocalizedName(LocalizedString localizedName)

      Localized name of the ShippingMethod.

      Parameters:
      localizedName - value to be set
    • setDescription

      @Deprecated void setDescription(String description)
      Deprecated.

      Description of the ShippingMethod.

      Parameters:
      description - value to be set
    • setLocalizedDescription

      void setLocalizedDescription(LocalizedString localizedDescription)

      Localized description of the ShippingMethod.

      Parameters:
      localizedDescription - value to be set
    • setTaxCategory

      void setTaxCategory(TaxCategoryResourceIdentifier taxCategory)

      TaxCategory for all ZoneRates of the ShippingMethod.

      Parameters:
      taxCategory - value to be set
    • setZoneRates

      void setZoneRates(ZoneRateDraft... zoneRates)

      Defines ShippingRates (prices) for specific zones.

      Parameters:
      zoneRates - values to be set
    • setZoneRates

      void setZoneRates(List<ZoneRateDraft> zoneRates)

      Defines ShippingRates (prices) for specific zones.

      Parameters:
      zoneRates - values to be set
    • setIsDefault

      void setIsDefault(Boolean isDefault)

      If true the ShippingMethod will be the Project's default ShippingMethod.

      Parameters:
      isDefault - value to be set
    • setPredicate

      void setPredicate(String predicate)

      Valid Cart predicate to select a ShippingMethod for a Cart.

      Parameters:
      predicate - value to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields for the ShippingMethod.

      Specified by:
      setCustom in interface CustomizableDraft<ShippingMethodDraft>
      Parameters:
      custom - value to be set
    • of

      static ShippingMethodDraft 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
    • deepCopy

      factory method to create a deep copy of ShippingMethodDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ShippingMethodDraftBuilder 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

      default <T> T withShippingMethodDraft(Function<ShippingMethodDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ShippingMethodDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference