Class ZoneRateDraftBuilder

java.lang.Object
com.commercetools.api.models.shipping_method.ZoneRateDraftBuilder
All Implemented Interfaces:
Builder<ZoneRateDraft>

public class ZoneRateDraftBuilder extends Object implements Builder<ZoneRateDraft>
ZoneRateDraftBuilder
Example to create an instance using the builder pattern

     ZoneRateDraft zoneRateDraft = ZoneRateDraft.builder()
             .zone(zoneBuilder -> zoneBuilder)
             .plusShippingRates(shippingRatesBuilder -> shippingRatesBuilder)
             .build()
 
  • Constructor Details

    • ZoneRateDraftBuilder

      public ZoneRateDraftBuilder()
  • Method Details

    • zone

      Sets the Zone for which the shippng rates are valid.

      Parameters:
      builder - function to build the zone value
      Returns:
      Builder
    • withZone

      Sets the Zone for which the shippng rates are valid.

      Parameters:
      builder - function to build the zone value
      Returns:
      Builder
    • zone

      Sets the Zone for which the shippng rates are valid.

      Parameters:
      zone - value to be set
      Returns:
      Builder
    • shippingRates

      public ZoneRateDraftBuilder shippingRates(ShippingRateDraft... shippingRates)

      Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

      Parameters:
      shippingRates - value to be set
      Returns:
      Builder
    • shippingRates

      public ZoneRateDraftBuilder shippingRates(List<ShippingRateDraft> shippingRates)

      Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

      Parameters:
      shippingRates - value to be set
      Returns:
      Builder
    • plusShippingRates

      public ZoneRateDraftBuilder plusShippingRates(ShippingRateDraft... shippingRates)

      Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

      Parameters:
      shippingRates - value to be set
      Returns:
      Builder
    • plusShippingRates

      Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

      Parameters:
      builder - function to build the shippingRates value
      Returns:
      Builder
    • withShippingRates

      Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

      Parameters:
      builder - function to build the shippingRates value
      Returns:
      Builder
    • addShippingRates

      Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

      Parameters:
      builder - function to build the shippingRates value
      Returns:
      Builder
    • setShippingRates

      Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

      Parameters:
      builder - function to build the shippingRates value
      Returns:
      Builder
    • getZone

      public ZoneResourceIdentifier getZone()

      Sets the Zone for which the shippng rates are valid.

      Returns:
      zone
    • getShippingRates

      public List<ShippingRateDraft> getShippingRates()

      Shipping rates for the currencies configured in the Project. The array must not contain two ShippingRates with the same CurrencyCode.

      Returns:
      shippingRates
    • build

      public ZoneRateDraft build()
      builds ZoneRateDraft with checking for non-null required values
      Specified by:
      build in interface Builder<ZoneRateDraft>
      Returns:
      ZoneRateDraft
    • buildUnchecked

      public ZoneRateDraft buildUnchecked()
      builds ZoneRateDraft without checking for non-null required values
      Returns:
      ZoneRateDraft
    • of

      public static ZoneRateDraftBuilder of()
      factory method for an instance of ZoneRateDraftBuilder
      Returns:
      builder
    • of

      public static ZoneRateDraftBuilder of(ZoneRateDraft template)
      create builder for ZoneRateDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder