java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.pagination.RenderedItem

@Internal public final class RenderedItem extends Object
One slot's worth of pagination engine output: a user-declared element builder, a plain frame item (a null item clears the slot), or the failure sentinel that keeps the slot's previous content entirely.

Consumers decode in this order: isFailure() first, then elementBuilder(), then plainItem() (where null clears the slot).

  • Method Details

    • ofElement

      @NotNull public static @NotNull RenderedItem ofElement(@NotNull @NotNull ItemComponentBuilderImpl builder)
      Creates a slot output backed by a user-declared page element.
      Parameters:
      builder - the element declaration to materialize at fill time, not null
      Returns:
      the rendered slot content
      Throws:
      NullPointerException - if builder is null
    • ofItem

      @NotNull public static @NotNull RenderedItem ofItem(@Nullable @Nullable org.bukkit.inventory.ItemStack item)
      Creates a plain frame item: a loading frame, a fallback filler or a slot clear.
      Parameters:
      item - the stack to paint, or null to clear the slot
      Returns:
      the rendered slot content
    • failure

      @NotNull public static @NotNull RenderedItem failure()
      Returns the failure sentinel: the slot keeps its previous content (item and click handlers); on a first paint with no previous content the fallback item is painted instead.
      Returns:
      the shared failure sentinel
    • elementBuilder

      @Nullable public @Nullable ItemComponentBuilderImpl elementBuilder()
      Returns the element declaration carried by this output.
      Returns:
      the element builder, or null unless created by ofElement(tech.guilhermekaua.spigotboot.inventoryapi.internal.component.ItemComponentBuilderImpl)
    • plainItem

      @Nullable public @Nullable org.bukkit.inventory.ItemStack plainItem()
      Returns the plain frame item carried by this output.
      Returns:
      the stack, or null for elements, failures and slot clears
    • isFailure

      public boolean isFailure()
      Returns whether this output is the failure sentinel.
      Returns:
      true for failure() outputs