Class Item

java.lang.Object
com.valhalla.sdk.api.items.Item
All Implemented Interfaces:
Identifiable, Nameable

public final class Item extends Object implements Identifiable, Nameable
Immutable container-slot snapshot used by inventory and equipment adapters.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Item(int id, int amount, int slot)
    Creates a basic container-slot snapshot.
    Item(int id, int amount, int slot, String name, boolean placeholder, boolean noted, int tab)
    Creates a complete immutable container-slot snapshot.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    equals(Object value)
     
    int
    Returns the captured stack amount.
    int
    Returns the item definition identifier.
    Returns the captured display name.
    int
    Returns the container slot.
    int
    Returns the captured bank tab.
    int
     
    boolean
    Reports whether this is a noted item.
    boolean
    Reports whether this is a bank placeholder.
    boolean
    Reports whether the captured amount exceeds one.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.valhalla.sdk.api.entities.Nameable

    hasName
  • Constructor Details

    • Item

      public Item(int id, int amount, int slot)
      Creates a basic container-slot snapshot.
      Parameters:
      id - item definition identifier
      amount - stack amount
      slot - zero-based container slot
    • Item

      public Item(int id, int amount, int slot, String name, boolean placeholder, boolean noted, int tab)
      Creates a complete immutable container-slot snapshot.
      Parameters:
      id - item definition identifier
      amount - stack amount
      slot - zero-based container slot
      name - captured display name, possibly blank
      placeholder - whether this is a bank placeholder
      noted - whether this is a noted item
      tab - bank tab index; values are constrained to 0 through 9
  • Method Details

    • getId

      public int getId()
      Returns the item definition identifier.
      Specified by:
      getId in interface Identifiable
      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

      public String getName()
      Returns the captured display name.
      Specified by:
      getName in interface Nameable
      Returns:
      captured display name, possibly blank
    • 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:
      true when the captured stack amount exceeds one
    • equals

      public boolean equals(Object value)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object