Package com.valhalla.sdk.testing
Class FakeInventory
java.lang.Object
com.valhalla.sdk.testing.FakeInventory
Mutable offline inventory fixture for script decision tests.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds one immutable item snapshot.all()Returns the fixture items in slot order.booleancontains(int id) Tests whether an item identifier is present.intcount(int id) Counts the total amount for one item identifier.booleanisEmpty()Returns whether the fixture contains no occupied slots.setItems(Collection<Item> values) Replaces the fixture contents with immutable item snapshots.
-
Constructor Details
-
FakeInventory
public FakeInventory()
-
-
Method Details
-
setItems
Replaces the fixture contents with immutable item snapshots. -
add
Adds one immutable item snapshot. -
all
Returns the fixture items in slot order. -
contains
public boolean contains(int id) Tests whether an item identifier is present. -
count
public int count(int id) Counts the total amount for one item identifier. -
isEmpty
public boolean isEmpty()Returns whether the fixture contains no occupied slots.
-