Package org.salespointframework.order
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 of
Streamable
of Priced
objects that expose a getTotal()
method so that the
combined price can be calculated easily.- Since:
- 7.1
- Author:
- Oliver Gierke
-
Method Summary
Modifier and Type Method Description default Totalable<T>
and(Iterable<? extends T> priced)
Creates a newTotalable
with the given one added to the current one.javax.money.MonetaryAmount
getTotal()
Returns the total of all thePriced
elements contained in thisTotalable
.static <T extends org.salespointframework.order.Priced>
Totalable<T>of(Iterable<T> priced)
-
Method Details
-
of
- Parameters:
priced
- must not be null.- Returns:
-
getTotal
javax.money.MonetaryAmount getTotal()Returns the total of all thePriced
elements contained in thisTotalable
.- Returns:
-
and
Creates a newTotalable
with the given one added to the current one.- Specified by:
and
in interfaceStreamable<T extends org.salespointframework.order.Priced>
- Parameters:
priced
- must not be null.- Returns:
-