Class InventoryItems<T extends InventoryItem<?>>
java.lang.Object
org.salespointframework.inventory.InventoryItems<T>
- All Implemented Interfaces:
Iterable<T>
,Supplier<Stream<T>>
,Streamable<T>
public class InventoryItems<T extends InventoryItem<?>> extends Object implements Streamable<T>
An abstraction over a collection of
InventoryItem
s. Offers convenience methods to handle cases in which a
lookup of InventoryItem
s for a Product
return multiple items or a UniqueInventoryItem
.- Since:
- 7.2
- Author:
- Oliver Drotbohm
-
Method Summary
Modifier and Type Method Description Quantity
getTotalQuantity()
Returns the total quantity of all theInventoryItem
s contained.Iterator<T>
iterator()
static <T extends InventoryItem<?>>
InventoryItems<T>of(@NonNull Streamable<T> items)
-
Method Details
-
getTotalQuantity
Returns the total quantity of all theInventoryItem
s contained.- Returns:
- will never be null.
-
iterator
- Specified by:
iterator
in interfaceIterable<T extends InventoryItem<?>>
-
of
public static <T extends InventoryItem<?>> InventoryItems<T> of(@NonNull @NonNull Streamable<T> items)
-