Class ViewConfig
java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.config.ViewConfig
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 TypeMethodDescriptionbooleanReturns whether placeholders are applied at paint time (defaulttrue).booleanReturns whether clicks are cancelled by default (defaulttrue).booleanReturns whether drags are cancelled by default (defaulttrue).layout()Returns the layout rows declared inonInit.introws()Returns the resolved row count, explicit or inferred from the layout.@NotNull Stringtitle()Returns the inventory title (legacy color codes allowed).longReturns the scheduled update interval in ticks;0means disabled.@NotNull ViewConfigwithOverrides(@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.
-
Method Details
-
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
Returns the layout rows declared inonInit.- Returns:
- an unmodifiable list of layout rows; empty when no layout was set
-
cancelOnClick
public boolean cancelOnClick()Returns whether clicks are cancelled by default (defaulttrue).- Returns:
- the cancel-on-click default
-
cancelOnDrag
public boolean cancelOnDrag()Returns whether drags are cancelled by default (defaulttrue).- Returns:
- the cancel-on-drag default
-
updateIntervalTicks
public long updateIntervalTicks()Returns the scheduled update interval in ticks;0means disabled.- Returns:
- the update interval in ticks
-
applyPlaceholders
public boolean applyPlaceholders()Returns whether placeholders are applied at paint time (defaulttrue).- 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, ornullto keep the current titlerows- the rows override, ornullto 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
-