Interface Totalable<T extends org.salespointframework.order.Priced>

All Superinterfaces:
Iterable<T>, Streamable<T>, Supplier<Stream<T>>

public interface Totalable<T extends org.salespointframework.order.Priced> extends Streamable<T>
An extension ofStreamable of Priced objects that expose a getTotal() method so that the combined price can be calculated easily.
Since:
7.1
Author:
Oliver Gierke
  • Method Details

    • of

      static <T extends org.salespointframework.order.Priced> Totalable<T> of(Iterable<T> priced)
      Creates a new Totalable for the given Iterable of Priced elements.
      Parameters:
      priced - must not be null.
      Returns:
    • getTotal

      javax.money.MonetaryAmount getTotal()
      Returns the total of all the Priced elements contained in this Totalable.
      Returns:
    • and

      default Totalable<T> and(Iterable<? extends T> priced)
      Creates a new Totalable with the given one added to the current one.
      Specified by:
      and in interface Streamable<T extends org.salespointframework.order.Priced>
      Parameters:
      priced - must not be null.
      Returns: