Interface ContentView

All Known Subinterfaces:
Content
All Known Implementing Classes:
DefaultContent

public interface ContentView
Read-only view of a menu's buttons.

Use this when code should inspect content but not change it.

  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Capacity
    Returns the capacity this content was created for.
    Returns the stored entries as a stream.
    void
    forEach(@NotNull BiConsumer<Slot,Button> consumer)
    Visits every stored button.
    @NotNull Optional<Button>
    get(@NotNull Slot slot)
    Returns the button at the given slot, if one exists.
    boolean
    Returns whether no buttons are present.
    @NotNull Optional<Slot>
    nextEmpty(@NotNull Slot from)
    Returns the next empty slot starting from from.
    int
    Returns the number of occupied slots.
  • Method Details

    • capacity

      @NotNull @NotNull Capacity capacity()
      Returns the capacity this content was created for.
    • get

      @NotNull @NotNull Optional<Button> get(@NotNull @NotNull Slot slot)
      Returns the button at the given slot, if one exists.
    • size

      int size()
      Returns the number of occupied slots.
    • isEmpty

      boolean isEmpty()
      Returns whether no buttons are present.
    • nextEmpty

      @NotNull @NotNull Optional<Slot> nextEmpty(@NotNull @NotNull Slot from)
      Returns the next empty slot starting from from.
    • entries

      @NotNull @NotNull Stream<Map.Entry<Slot,Button>> entries()
      Returns the stored entries as a stream.
    • forEach

      void forEach(@NotNull @NotNull BiConsumer<Slot,Button> consumer)
      Visits every stored button.