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
ConstructorsConstructorDescriptionItem(int id, int amount, int slot) Creates a basic container-slot snapshot.Creates a complete immutable container-slot snapshot.Item(int id, int amount, int slot, String name, boolean placeholder, boolean noted, int tab, List<String> actions) Creates a complete immutable container-slot snapshot with exact live or revision-pinned inventory actions. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns action labels in native component-operation order.intReturns 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.booleanTests whether this item exposes an exact action, ignoring case.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
-
Item
public Item(int id, int amount, int slot, String name, boolean placeholder, boolean noted, int tab, List<String> actions) Creates a complete immutable container-slot snapshot with exact live or revision-pinned inventory actions.
-
-
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
-
getActions
Returns action labels in native component-operation order. -
hasAction
Tests whether this item exposes an exact action, ignoring case. -
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
-