Class InventoryItems<T extends InventoryItem<?>>
java.lang.Object
org.salespointframework.inventory.InventoryItems<T>
- All Implemented Interfaces:
Iterable<T>
,Supplier<Stream<T>>
,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 TypeMethodDescriptionReturns the total quantity of all theInventoryItem
s contained.iterator()
static <T extends InventoryItem<?>>
InventoryItems<T> of
(@NonNull Streamable<T> items) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
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)
-