Interface Content

All Superinterfaces:
ContentEditor, ContentView
All Known Implementing Classes:
DefaultContent

public interface Content extends ContentView, ContentEditor
Full read-write content for a menu.

This combines the read-only view from ContentView with the write operations from ContentEditor.

  • Method Details

    • mergeWith

      @NotNull @NotNull Content mergeWith(@NotNull @NotNull ContentView other)
      Returns a new content object with entries from both sources.

      Entries from other overwrite entries from this content when both use the same slot.

    • trimTo

      void trimTo(int maxButtons)
      Removes extra buttons after the given limit is reached.
    • add

      @NotNull default @NotNull Optional<Slot> add(@NotNull @NotNull Button button)
      Places the button into the first empty slot, returning that slot if one was found.
    • empty

      @NotNull static @NotNull Content empty(@NotNull @NotNull Capacity capacity)
      Creates an empty content object for the given capacity.
    • builder

      @NotNull static @NotNull ContentBuilder builder(@NotNull @NotNull Capacity capacity)
      Creates a builder for the given capacity.