Package com.valhalla.sdk.api.items
Class Item
java.lang.Object
com.valhalla.sdk.api.items.Item
- All Implemented Interfaces:
Identifiable,Nameable
Immutable container-slot snapshot used by inventory and equipment adapters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns the captured stack amount.intgetId()Returns the item definition identifier.getName()Returns the captured display name.intgetSlot()Returns the container slot.intgetTab()Returns the captured bank tab.inthashCode()booleanisNoted()Reports whether this is a noted item.booleanReports whether this is a bank placeholder.booleanReports whether the captured amount exceeds one.toString()
-
Constructor Details
-
Item
public Item(int id, int amount, int slot) Creates a basic container-slot snapshot.- Parameters:
id- item definition identifieramount- stack amountslot- zero-based container slot
-
Item
Creates a complete immutable container-slot snapshot.- Parameters:
id- item definition identifieramount- stack amountslot- zero-based container slotname- captured display name, possibly blankplaceholder- whether this is a bank placeholdernoted- whether this is a noted itemtab- bank tab index; values are constrained to 0 through 9
-
-
Method Details
-
getId
public int getId()Returns the item definition identifier.- Specified by:
getIdin interfaceIdentifiable- Returns:
- item definition identifier
-
getAmount
public int getAmount()Returns the captured stack amount.- Returns:
- stack amount captured in this slot
-
getSlot
public int getSlot()Returns the container slot.- Returns:
- zero-based container slot
-
getName
Returns the captured display name. -
isPlaceholder
public boolean isPlaceholder()Reports whether this is a bank placeholder.- Returns:
- whether this snapshot represents a bank placeholder
-
isNoted
public boolean isNoted()Reports whether this is a noted item.- Returns:
- whether this snapshot represents a noted item
-
getTab
public int getTab()Returns the captured bank tab.- Returns:
- bank tab index from 0 through 9
-
isStackableAmount
public boolean isStackableAmount()Reports whether the captured amount exceeds one.- Returns:
truewhen the captured stack amount exceeds one
-
equals
-
hashCode
public int hashCode() -
toString
-