Class BankSnapshot

java.lang.Object
com.valhalla.sdk.api.bank.BankSnapshot

public final class BankSnapshot extends Object
Immutable native bank-container and interface-state snapshot.
  • Field Details

    • DEFAULT_CAPACITY

      public static final int DEFAULT_CAPACITY
      Fallback number of bank slots when the native client does not report one.
      See Also:
  • Constructor Details

    • BankSnapshot

      public BankSnapshot(List<Item> items, boolean loaded, boolean open, int capacity, int currentTab, int availableTabs, int scrollHeight, int customWithdrawAmount, int firstVisibleSlot, int lastVisibleSlot, BankMode withdrawMode, BankMode rearrangeMode, BankQuantitySelection defaultQuantity, boolean placeholdersEnabled, boolean searchOpen, long updatedTick)
      Creates an immutable bank snapshot from native container and interface state.
      Parameters:
      items - occupied bank slots
      loaded - whether bank state was decoded
      open - whether the bank interface is open
      capacity - total slot capacity
      currentTab - selected tab identifier
      availableTabs - number of optional tabs
      scrollHeight - current scroll offset
      customWithdrawAmount - configured X amount
      firstVisibleSlot - first visible slot, or -1
      lastVisibleSlot - last visible slot, or -1
      withdrawMode - item or note withdrawal mode
      rearrangeMode - swap or insert rearrangement mode
      defaultQuantity - selected amount button
      placeholdersEnabled - whether placeholders are enabled
      searchOpen - whether bank search is open
      updatedTick - native update tick
  • Method Details

    • empty

      public static BankSnapshot empty()
      Returns an unloaded, closed bank snapshot with safe defaults.
      Returns:
      an unloaded, closed bank snapshot with safe defaults
    • getItems

      public List<Item> getItems()
      Returns an immutable list of occupied bank slots.
      Returns:
      an immutable list of occupied bank slots
    • isLoaded

      public boolean isLoaded()
      Returns whether bank state was successfully decoded.
      Returns:
      whether bank state was successfully decoded
    • isOpen

      public boolean isOpen()
      Returns whether the bank interface is open.
      Returns:
      whether the bank interface is open
    • getCapacity

      public int getCapacity()
      Returns the total bank slot capacity.
      Returns:
      the total bank slot capacity
    • getCurrentTab

      public int getCurrentTab()
      Returns the selected tab identifier.
      Returns:
      the selected tab identifier
    • getAvailableTabs

      public int getAvailableTabs()
      Returns the number of available optional tabs.
      Returns:
      the number of available optional tabs
    • getScrollHeight

      public int getScrollHeight()
      Returns the bank-container scroll offset.
      Returns:
      the bank-container scroll offset
    • getCustomWithdrawAmount

      public int getCustomWithdrawAmount()
      Returns the configured custom withdrawal amount.
      Returns:
      the configured custom withdrawal amount
    • getFirstVisibleSlot

      public int getFirstVisibleSlot()
      Returns the first visible bank slot, or -1.
      Returns:
      the first visible bank slot, or -1
    • getLastVisibleSlot

      public int getLastVisibleSlot()
      Returns the last visible bank slot, or -1.
      Returns:
      the last visible bank slot, or -1
    • getWithdrawMode

      public BankMode getWithdrawMode()
      Returns the current item-or-note withdrawal mode.
      Returns:
      the current item-or-note withdrawal mode
    • getRearrangeMode

      public BankMode getRearrangeMode()
      Returns the current swap-or-insert rearrangement mode.
      Returns:
      the current swap-or-insert rearrangement mode
    • getDefaultQuantity

      public BankQuantitySelection getDefaultQuantity()
      Returns the selected default quantity button.
      Returns:
      the selected default quantity button
    • isPlaceholdersEnabled

      public boolean isPlaceholdersEnabled()
      Returns whether bank placeholders are enabled.
      Returns:
      whether bank placeholders are enabled
    • isSearchOpen

      public boolean isSearchOpen()
      Returns whether the bank search interface is open.
      Returns:
      whether the bank search interface is open
    • getUpdatedTick

      public long getUpdatedTick()
      Returns the native tick on which this snapshot was updated.
      Returns:
      the native tick on which this snapshot was updated