java.lang.Object
tech.guilhermekaua.spigotboot.inventoryapi.internal.component.ComponentTable

@Internal public final class ComponentTable extends Object
Per-session component registry: maps slots to their owning component and resolves the components watching a set of dirty token ids. Rejects slot overlaps and components without an item source at registration time.
  • Constructor Details

    • ComponentTable

      public ComponentTable()
  • Method Details

    • add

      public void add(@NotNull @NotNull ComponentInstance component)
      Registers a component; validated before any slot is bound so a failed add leaves the table unchanged.
      Throws:
      ViewConfigurationException - on slot overlap or when the component declares no item source
    • componentAt

      @Nullable public @Nullable ComponentInstance componentAt(int slot)
      Returns:
      the component bound to the slot, or null when the slot is component-less
    • all

      @NotNull public @NotNull List<ComponentInstance> all()
      Returns:
      all registered components in declaration order; unmodifiable
    • watchersOf

      @NotNull public @NotNull List<ComponentInstance> watchersOf(@NotNull @NotNull Set<Integer> dirtyTokenIds)
      Resolves the components whose watched token ids intersect the dirty set, in declaration order.