Interface InventoryTransactionResult
- All Known Subinterfaces:
- InventoryTransactionResult.Poll
public interface InventoryTransactionResult
An interface for data returned by inventory operations which encapsulates the
 result of an attempted operation.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfaceThe InventoryTransactionResult for a singleInventory.poll()operation.static enumThe type of InventoryTransactionResult.
- 
Method SummaryModifier and TypeMethodDescriptionand(InventoryTransactionResult other) Combines two transaction-results into one.builder()Begin building a new InventoryTransactionResult.static InventoryTransactionResultReturns a builder which indicates that the transaction failed, and the transaction result was no-op.Returns the items polled by the operation.Returns items that were supplied to the operation but rejected by the inventory.voidrevert()Reverts all SlotTransactions from this transaction-resultbooleanReverts all SlotTransactions from this transaction-result if it was aInventoryTransactionResult.Type.FAILUREReturns theSlotTransactions that were executed by the operation.static InventoryTransactionResultReturns a builder which indicates that the transaction succeeded, but the transaction result was no-op.type()Gets the type of result.
- 
Method Details- 
builderBegin building a new InventoryTransactionResult.- Returns:
- A new builder
 
- 
successNoTransactionsReturns a builder which indicates that the transaction succeeded, but the transaction result was no-op.- Returns:
- A new transaction result
 
- 
failNoTransactionsReturns a builder which indicates that the transaction failed, and the transaction result was no-op.- Returns:
- A new transaction result
 
- 
andCombines two transaction-results into one. All slot-transactions, rejected and polled items are combined. The resulting type is the first of this list to occur:InventoryTransactionResult.Type.ERROR,InventoryTransactionResult.Type.FAILURE,InventoryTransactionResult.Type.NO_SLOT,InventoryTransactionResult.Type.SUCCESS- Parameters:
- other- The other transaction-result.
- Returns:
- The combined transaction-result.
 
- 
revertvoid revert()Reverts all SlotTransactions from this transaction-result
- 
revertOnFailureboolean revertOnFailure()Reverts all SlotTransactions from this transaction-result if it was aInventoryTransactionResult.Type.FAILURE- Returns:
- true when the transactions were reverted.
 
- 
typeGets the type of result.- Returns:
- the type of result
 
- 
rejectedItemsList<ItemStackSnapshot> rejectedItems()Returns items that were supplied to the operation but rejected by the inventory.- Returns:
- the items which were rejected by the inventory.
 
- 
polledItemsList<ItemStackSnapshot> polledItems()Returns the items polled by the operation.- Returns:
- the items which were polled from the inventory.
 
- 
slotTransactionsList<SlotTransaction> slotTransactions()Returns theSlotTransactions that were executed by the operation.- Returns:
- the slot-transactions caused by the inventory operation
 
 
-