java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.config.ViewConfig

public final class ViewConfig extends Object
Immutable, validated view configuration produced by ViewConfigBuilder.build(); frozen at registration and merged with per-open overrides via withOverrides(java.lang.String, java.lang.Integer).
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether placeholders are applied at paint time (default true).
    boolean
    Returns whether clicks are cancelled by default (default true).
    boolean
    Returns whether drags are cancelled by default (default true).
    @NotNull List<String>
    Returns the layout rows declared in onInit.
    int
    Returns the resolved row count, explicit or inferred from the layout.
    @NotNull String
    Returns the inventory title (legacy color codes allowed).
    long
    Returns the scheduled update interval in ticks; 0 means disabled.
    @NotNull ViewConfig
    withOverrides(@Nullable String title, @Nullable Integer rows)
    Returns a copy of this config with the given non-null per-open overrides applied; this instance is unchanged.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • title

      @NotNull public @NotNull String title()
      Returns the inventory title (legacy color codes allowed).
      Returns:
      the title, never null
    • rows

      public int rows()
      Returns the resolved row count, explicit or inferred from the layout.
      Returns:
      the row count within 1-6
    • layout

      @NotNull public @NotNull List<String> layout()
      Returns the layout rows declared in onInit.
      Returns:
      an unmodifiable list of layout rows; empty when no layout was set
    • cancelOnClick

      public boolean cancelOnClick()
      Returns whether clicks are cancelled by default (default true).
      Returns:
      the cancel-on-click default
    • cancelOnDrag

      public boolean cancelOnDrag()
      Returns whether drags are cancelled by default (default true).
      Returns:
      the cancel-on-drag default
    • updateIntervalTicks

      public long updateIntervalTicks()
      Returns the scheduled update interval in ticks; 0 means disabled.
      Returns:
      the update interval in ticks
    • applyPlaceholders

      public boolean applyPlaceholders()
      Returns whether placeholders are applied at paint time (default true).
      Returns:
      the apply-placeholders flag
    • withOverrides

      @NotNull public @NotNull ViewConfig withOverrides(@Nullable @Nullable String title, @Nullable @Nullable Integer rows)
      Returns a copy of this config with the given non-null per-open overrides applied; this instance is unchanged.
      Parameters:
      title - the title override, or null to keep the current title
      rows - the rows override, or null to keep the current rows
      Returns:
      a new config with the overrides applied
      Throws:
      ViewConfigurationException - if a non-null rows override is outside 1-6, or does not match the row count of a non-empty layout