Class OrderUtils

java.lang.Object
de.hybris.platform.ruleengineservices.util.OrderUtils

public class OrderUtils extends Object
The class provides some utility methods related to Order functionality.
  • Constructor Details

    • OrderUtils

      public OrderUtils()
  • Method Details

    • createShippingCharge

      public OrderCharge createShippingCharge(Currency currency, boolean absolute, BigDecimal value)
      Creates an OrderCharge of AbstractCharge.ChargeType.SHIPPING for the given values.
      Parameters:
      currency - the currency to use
      absolute - whether the shipping charge is percentage-based or absolute.
      value - the value of the charge
      Returns:
      the newly created OrderCharge
    • updateOrderQuantities

      public void updateOrderQuantities(OrderModel order, Map<Integer,Long> quantities)
      Updates multiple order entry quantities at once. Entries that receive a quantity < 1 will be removed as well as entries that receive NULL as quantity value. Refreshes a given cart instance after that. Entries with entry numbers that do not occur in the parameter map are not touched.
      Parameters:
      order - the order to update order entry quantities at
      quantities - the entry specific quantities as map of { entry number -> quantity }
    • getEntryQuantityMap

      protected Map<OrderEntryModel,Long> getEntryQuantityMap(OrderModel order, Map<Integer,Long> quantities)
    • getEntry

      protected OrderEntryModel getEntry(List<OrderEntryModel> entries, Integer entryNumber)
    • getModelService

      protected ModelService getModelService()
    • setModelService

      public void setModelService(ModelService modelService)