Interface AdvancedInventoryItemService

All Known Implementing Classes:
SuperUserAdvancedInventoryItemService, UserAdvancedInventoryItemService

public interface AdvancedInventoryItemService
Allows for modification of the inventory using the advanced API.
  • Method Details

    • getInventoryItem

      InventoryItem getInventoryItem(String inventoryItemId)
      Returns the InventoryItem associated with the specified id.
      Parameters:
      inventoryItemId - the id of the as specified by InventoryItem.getId()
      Returns:
      the InventoryItem associated with specified item
    • getInventoryItems

      Pagination<InventoryItem> getInventoryItems(int offset, int count, String userId)
      Returns a list of InventoryItem objects.
      Parameters:
      offset - the offset
      count - the count
      userId - the user id to filter, pass null or empty to fetch all
      Returns:
      the list of InventoryItem instances
    • getInventoryItems

      Pagination<InventoryItem> getInventoryItems(int offset, int count, String userId, String query)
      Returns a list of InventoryItem objects.
      Parameters:
      offset - the offset
      count - the count
      userId - the user id to filter, pass null or empty to fetch all
      query - the search query
      Returns:
      the list of InventoryItem instances
    • adjustInventoryItemQuantity

      InventoryItem adjustInventoryItemQuantity(String inventoryItemId, int quantityDelta)
      Adjusts the quantity of the InventoryItem associated with the specified Item.
      Parameters:
      inventoryItemId - the value of InventoryItem.getId()
      quantityDelta - the amount by which to adjust the quantity of the InventoryItem
      Returns:
      the InventoryItem as it was written to the database
    • createInventoryItem

      InventoryItem createInventoryItem(String userId, String itemId, int quantity, int priority)
      Creates a new InventoryItem for the specified Item.
      Parameters:
      userId - the user to own the InventoryItem
      itemId - the Item.getName() or Item.getId() to use.
      quantity - the initial quantity
      priority - the priority slot
      Returns:
      the InventoryItem as it was written to the database
    • updateInventoryItem

      InventoryItem updateInventoryItem(String inventoryItemId, int quantity)
      Updates an inventory item with the supplied user id, item id, and quantity.
      Parameters:
      inventoryItemId - the inventory item id
      quantity - the quantity to set
      Returns:
      the updated InventoryItem
    • deleteInventoryItem

      void deleteInventoryItem(String inventoryItemId)
      Deletes an InventoryItem from the given User's inventory.
      Parameters:
      inventoryItemId - the InventoryItem's id.