Package com.storedobject.core
Interface HasInventoryItem
- All Superinterfaces:
HasInventoryItemType
- All Known Implementing Classes:
InventoryFitmentPosition,InventoryGRNItem,InventoryItem,InventoryLedger,InventoryLoanOutItem,InventoryReturnItem,InventoryROItem,InventorySaleItem,InventoryTransferItem,MaterialIssuedItem,MaterialReturnedItem,MaterialTransferredItem,ServiceItem,SubscriptionItem
Represents an entity that has an associated inventory item and provides methods to access it.
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptiondefault InventoryItemRetrieves the inventory item associated with this entity.default InventoryItemTypeReturns the InventoryItemType (P/N) associated with this object.getItem()Retrieves the inventory item associated with this entity.default InventoryItemRetrieves the inventory item from the entity's history if applicable.default QuantityRetrieves the quantity of the inventory item associated with this entity.
-
Method Details
-
getInventoryItem
Retrieves the inventory item associated with this entity.- Returns:
- the associated InventoryItem instance
-
getItem
InventoryItem getItem()Retrieves the inventory item associated with this entity.- Returns:
- the associated InventoryItem instance
-
getQuantity
Retrieves the quantity of the inventory item associated with this entity.- Returns:
- the quantity of the associated inventory item
-
getInventoryItemType
Description copied from interface:HasInventoryItemTypeReturns the InventoryItemType (P/N) associated with this object.- Specified by:
getInventoryItemTypein interfaceHasInventoryItemType- Returns:
- the InventoryItemType representing the type of the inventory item (P/N).
-
getItemFromHistory
Retrieves the inventory item from the entity's history if applicable. If the current object is a stored entity (e.g., an instance of StoredObject), it attempts to find a historical version of the associated inventory item. If found, it returns the historical inventory item; otherwise, it returns the current inventory item.- Returns:
- the historical InventoryItem if available and valid, or the current InventoryItem if no historical version exists.
-