Class SuperUserAdvancedInventoryItemService
java.lang.Object
dev.getelements.elements.service.inventory.SuperUserAdvancedInventoryItemService
- All Implemented Interfaces:
AdvancedInventoryItemService
public class SuperUserAdvancedInventoryItemService
extends Object
implements AdvancedInventoryItemService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadjustInventoryItemQuantity
(String inventoryItemId, int quantityDelta) Adjusts the quantity of theInventoryItem
associated with the specifiedItem
.createInventoryItem
(String userId, String itemId, int initialQuantity, int priority) Creates a newInventoryItem
for the specifiedItem
.void
deleteInventoryItem
(String inventoryItemId) Deletes anInventoryItem
from the givenUser
's inventory.getInventoryItem
(String inventoryItemId) Returns theInventoryItem
associated with the specified id.getInventoryItems
(int offset, int count, String userId) Returns a list ofInventoryItem
objects.getInventoryItems
(int offset, int count, String userId, String query) Returns a list ofInventoryItem
objects.getUser()
void
setInventoryItemDao
(InventoryItemDao inventoryItemDao) void
setItemDao
(ItemDao itemDao) void
void
setUserDao
(UserDao userDao) updateInventoryItem
(String inventoryItemId, int quantity) Updates an inventory item with the supplied user id, item id, and quantity.
-
Constructor Details
-
SuperUserAdvancedInventoryItemService
public SuperUserAdvancedInventoryItemService()
-
-
Method Details
-
getInventoryItem
Description copied from interface:AdvancedInventoryItemService
Returns theInventoryItem
associated with the specified id.- Specified by:
getInventoryItem
in interfaceAdvancedInventoryItemService
- Parameters:
inventoryItemId
- the id of the as specified byInventoryItem.getId()
- Returns:
- the
InventoryItem
associated with specified item
-
getInventoryItems
Description copied from interface:AdvancedInventoryItemService
Returns a list ofInventoryItem
objects.- Specified by:
getInventoryItems
in interfaceAdvancedInventoryItemService
- Parameters:
offset
- the offsetcount
- the countuserId
- the user id to filter, pass null or empty to fetch all- Returns:
- the list of
InventoryItem
instances
-
getInventoryItems
public Pagination<InventoryItem> getInventoryItems(int offset, int count, String userId, String query) Description copied from interface:AdvancedInventoryItemService
Returns a list ofInventoryItem
objects.- Specified by:
getInventoryItems
in interfaceAdvancedInventoryItemService
- Parameters:
offset
- the offsetcount
- the countuserId
- the user id to filter, pass null or empty to fetch allquery
- the search query- Returns:
- the list of
InventoryItem
instances
-
adjustInventoryItemQuantity
Description copied from interface:AdvancedInventoryItemService
Adjusts the quantity of theInventoryItem
associated with the specifiedItem
.- Specified by:
adjustInventoryItemQuantity
in interfaceAdvancedInventoryItemService
- Parameters:
inventoryItemId
- the value ofInventoryItem.getId()
quantityDelta
- the amount by which to adjust the quantity of theInventoryItem
- Returns:
- the
InventoryItem
as it was written to the database
-
updateInventoryItem
Description copied from interface:AdvancedInventoryItemService
Updates an inventory item with the supplied user id, item id, and quantity.- Specified by:
updateInventoryItem
in interfaceAdvancedInventoryItemService
- Parameters:
inventoryItemId
- the inventory item idquantity
- the quantity to set- Returns:
- the updated
InventoryItem
-
createInventoryItem
public InventoryItem createInventoryItem(String userId, String itemId, int initialQuantity, int priority) Description copied from interface:AdvancedInventoryItemService
Creates a newInventoryItem
for the specifiedItem
.- Specified by:
createInventoryItem
in interfaceAdvancedInventoryItemService
- Parameters:
userId
- the user to own theInventoryItem
itemId
- theItem.getName()
orItem.getId()
to use.initialQuantity
- the initial quantitypriority
- the priority slot- Returns:
- the
InventoryItem
as it was written to the database
-
deleteInventoryItem
Description copied from interface:AdvancedInventoryItemService
Deletes anInventoryItem
from the givenUser
's inventory.- Specified by:
deleteInventoryItem
in interfaceAdvancedInventoryItemService
- Parameters:
inventoryItemId
- theInventoryItem
's id.
-
getUserDao
-
setUserDao
-
getUser
-
setUser
-
getItemDao
-
setItemDao
-
getInventoryItemDao
-
setInventoryItemDao
-