Class InventoryItems<T extends InventoryItem<?>>
- java.lang.Object
-
- org.salespointframework.inventory.InventoryItems<T>
-
- All Implemented Interfaces:
Iterable<T>
,Supplier<Stream<T>>
,org.springframework.data.util.Streamable<T>
public class InventoryItems<T extends InventoryItem<?>> extends Object implements org.springframework.data.util.Streamable<T>
An abstraction over a collection ofInventoryItem
s. Offers convenience methods to handle cases in which a lookup ofInventoryItem
s for aProduct
return multiple items or aUniqueInventoryItem
.- Since:
- 7.2
- Author:
- Oliver Drotbohm
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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 org.springframework.data.util.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 Detail
-
getTotalQuantity
public Quantity getTotalQuantity()
Returns the total quantity of all theInventoryItem
s contained.- Returns:
- will never be null.
-
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interfaceIterable<T extends InventoryItem<?>>
-
of
public static <T extends InventoryItem<?>> InventoryItems<T> of(@NonNull @NonNull org.springframework.data.util.Streamable<T> items)
-
-