Class NpcDefinition

java.lang.Object
com.valhalla.sdk.api.entities.NpcDefinition
All Implemented Interfaces:
Identifiable, Nameable

public final class NpcDefinition extends Object implements Identifiable, Nameable
Immutable NPC cache definition from the active adapter's reviewed OSRS revision. Empty action entries are retained so their list index maps to NpcAction's native menu slot.
  • Constructor Details

    • NpcDefinition

      public NpcDefinition(int id, String name, List<String> actions)
      Creates one revision-pinned NPC definition.
      Parameters:
      id - cache definition identifier
      name - exact cache name, including any game markup
      actions - cache menu slots zero through four, retaining empty slots
  • Method Details

    • getId

      public int getId()
      Description copied from interface: Identifiable
      Returns the client definition or item identifier captured in this snapshot.
      Specified by:
      getId in interface Identifiable
      Returns:
      cache definition identifier
    • getName

      public String getName()
      Description copied from interface: Nameable
      Returns the captured display name.
      Specified by:
      getName in interface Nameable
      Returns:
      exact cache name, possibly including game markup
    • getActions

      public List<String> getActions()
      Returns:
      immutable cache action slots in native menu order
    • findAction

      public Optional<NpcAction> findAction(String action)
      Resolves one exact action label to a typed native action slot.
      Returns:
      empty when absent or ambiguous
    • hasAction

      public boolean hasAction(String action)
      Returns:
      whether an exact action label occurs in this cache definition
    • 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