Class PromotionOrderEntry

  • All Implemented Interfaces:
    java.lang.Comparable

    public class PromotionOrderEntry
    extends java.lang.Object
    implements java.lang.Comparable
    An entry as viewed from the PromotionEvaluationContext. This entry always shows the current state of the promotions
    • Method Detail

      • consume

        public PromotionOrderEntryConsumed consume​(SessionContext ctx,
                                                   AbstractPromotion promotion,
                                                   long quantity)
        Inform the context that a promotion wishes to consume the specified property of.
        Parameters:
        ctx - The currency context to use
        promotion - The promotion wishing to consume some of an order entry
        quantity - The quantity of the order entry to consume
        Returns:
        The remaining quantity of the order entry
      • getQuantity

        public long getQuantity​(SessionContext ctx)
        Find the quantity of this orderEntry remaining after other promotions have run.
        Parameters:
        ctx - The context to use
        Returns:
        The remaining quantity
      • getBaseProducts

        public java.util.List<Product> getBaseProducts​(SessionContext ctx)
        Returns a collection of base products for this order entry. Returns the current product if the product is not an instance of VariantProduct or CompositeProduct otherwise the relevant base product is returned.
        Parameters:
        ctx - The hybris context
        Returns:
        The base Product that this entry is for
      • getBasePrice

        public java.lang.Double getBasePrice​(SessionContext ctx)
        Returns the unit price of the product in this order entry.
        Parameters:
        ctx - The hybris context
        Returns:
        The unit price of the product
      • compareTo

        public int compareTo​(java.lang.Object o)
        Compare to another object.
        Specified by:
        compareTo in interface java.lang.Comparable
        Parameters:
        o - The object to compare to
        Returns:
        See Comparable.compareTo(T)
      • getBaseOrderEntry

        public AbstractOrderEntry getBaseOrderEntry()
        Get the base order entry.
        Returns:
        the base order entry