Class RenderedItem
java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.pagination.RenderedItem
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 Summary
Modifier and TypeMethodDescription@Nullable ItemComponentBuilderImplReturns the element declaration carried by this output.static @NotNull RenderedItemfailure()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.booleanReturns whether this output is the failure sentinel.static @NotNull RenderedItemofElement(@NotNull ItemComponentBuilderImpl builder) Creates a slot output backed by a user-declared page element.static @NotNull RenderedItemofItem(@Nullable org.bukkit.inventory.ItemStack item) Creates a plain frame item: a loading frame, a fallback filler or a slot clear.@Nullable org.bukkit.inventory.ItemStackReturns the plain frame item carried by this output.
-
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- ifbuilderis 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, ornullto clear the slot- Returns:
- the rendered slot content
-
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
Returns the element declaration carried by this output.- Returns:
- the element builder, or
nullunless created byofElement(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
nullfor elements, failures and slot clears
-
isFailure
public boolean isFailure()Returns whether this output is the failure sentinel.- Returns:
trueforfailure()outputs
-