Interface ZoneRate


public interface ZoneRate

Defines shipping rates in different currencies for a specific Zone.


Example to create an instance using the builder pattern

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

    • getZone

      @NotNull @Valid @NotNull @Valid ZoneReference getZone()

      Zone for which the shipping rates are valid.

      Returns:
      zone
    • getShippingRates

      @NotNull @Valid @NotNull @Valid List<ShippingRate> getShippingRates()

      Shipping rates defined per currency.

      Returns:
      shippingRates
    • setZone

      void setZone(ZoneReference zone)

      Zone for which the shipping rates are valid.

      Parameters:
      zone - value to be set
    • setShippingRates

      void setShippingRates(ShippingRate... shippingRates)

      Shipping rates defined per currency.

      Parameters:
      shippingRates - values to be set
    • setShippingRates

      void setShippingRates(List<ShippingRate> shippingRates)

      Shipping rates defined per currency.

      Parameters:
      shippingRates - values to be set
    • of

      static ZoneRate of()
      factory method
      Returns:
      instance of ZoneRate
    • of

      static ZoneRate of(ZoneRate template)
      factory method to create a shallow copy ZoneRate
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static ZoneRate deepCopy(@Nullable ZoneRate template)
      factory method to create a deep copy of ZoneRate
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ZoneRateBuilder builder()
      builder factory method for ZoneRate
      Returns:
      builder
    • builder

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

      default <T> T withZoneRate(Function<ZoneRate,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<ZoneRate> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference