Package net.okocraft.box.api.transaction
Interface StockHolderTransaction.Deposit
- Enclosing class:
StockHolderTransaction
public static interface StockHolderTransaction.Deposit
An interface to deposit items to
StockHolder.-
Method Summary
Modifier and TypeMethodDescription@NotNull @Unmodifiable List<TransactionResult> fromInventory(@NotNull Inventory inventory, StockEvent.Cause cause) Deposits items fromInventory.@NotNull @Unmodifiable List<TransactionResult> fromTopInventory(@NotNull InventoryView view, StockEvent.Cause cause) Deposits items fromInventoryView.getTopInventory().
-
Method Details
-
fromInventory
@NotNull @NotNull @Unmodifiable List<TransactionResult> fromInventory(@NotNull @NotNull Inventory inventory, @NotNull StockEvent.Cause cause) Deposits items fromInventory.If no items are deposited, this method returns
Collections.emptyList()- Parameters:
inventory- anInventoryto pull out itemscause- aStockEvent.Causethat is passed toStockHolder.increase(BoxItem, int, StockEvent.Cause)- Returns:
- a list that contains
TransactionResults per item orCollections.emptyList()if no items are deposited - Throws:
NullPointerException- ifinventoryorcauseis null
-
fromTopInventory
@NotNull @NotNull @Unmodifiable List<TransactionResult> fromTopInventory(@NotNull @NotNull InventoryView view, @NotNull StockEvent.Cause cause) Deposits items fromInventoryView.getTopInventory().If no items are deposited, this method returns
Collections.emptyList()This method calls
InventoryClickEvents before pulling out the item.- Parameters:
view- anInventoryViewto get topInventorycause- aStockEvent.Causethat is passed toStockHolder.increase(BoxItem, int, StockEvent.Cause)- Returns:
- a list that contains
TransactionResults per item orCollections.emptyList()if no items are deposited - Throws:
NullPointerException- ifvieworcauseis null
-