Class ZoneRateBuilder

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

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

     ZoneRate zoneRate = ZoneRate.builder()
             .zone(zoneBuilder -> zoneBuilder)
             .plusShippingRates(shippingRatesBuilder -> shippingRatesBuilder)
             .build()
 
  • Constructor Details

    • ZoneRateBuilder

      public ZoneRateBuilder()
  • Method Details

    • zone

      Zone for which the shipping rates are valid.

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

      Zone for which the shipping rates are valid.

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

      public ZoneRateBuilder zone(ZoneReference zone)

      Zone for which the shipping rates are valid.

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

      public ZoneRateBuilder shippingRates(ShippingRate... shippingRates)

      Shipping rates defined per currency.

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

      public ZoneRateBuilder shippingRates(List<ShippingRate> shippingRates)

      Shipping rates defined per currency.

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

      public ZoneRateBuilder plusShippingRates(ShippingRate... shippingRates)

      Shipping rates defined per currency.

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

      public ZoneRateBuilder plusShippingRates(Function<ShippingRateBuilder,ShippingRateBuilder> builder)

      Shipping rates defined per currency.

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

      public ZoneRateBuilder withShippingRates(Function<ShippingRateBuilder,ShippingRateBuilder> builder)

      Shipping rates defined per currency.

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

      public ZoneRateBuilder addShippingRates(Function<ShippingRateBuilder,ShippingRate> builder)

      Shipping rates defined per currency.

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

      public ZoneRateBuilder setShippingRates(Function<ShippingRateBuilder,ShippingRate> builder)

      Shipping rates defined per currency.

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

      public ZoneReference getZone()

      Zone for which the shipping rates are valid.

      Returns:
      zone
    • getShippingRates

      public List<ShippingRate> getShippingRates()

      Shipping rates defined per currency.

      Returns:
      shippingRates
    • build

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

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

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

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