Class SlotIterator.Builder

java.lang.Object
io.github.rysefoxx.inventory.plugin.pagination.SlotIterator.Builder
Enclosing class:
SlotIterator

public static class SlotIterator.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • copy

      @NotNull public @NotNull SlotIterator.Builder copy(@NotNull @NotNull SlotIterator iterator)
      Copies the values of the given SlotIterator into this builder.
      Parameters:
      iterator - the SlotIterator to copy the values from
      Returns:
      The builder object itself.
    • blackList

      @NotNull public @NotNull SlotIterator.Builder blackList(@Nonnegative int slot)
      Adds a slot to the blacklist.
      Parameters:
      slot - The slot to add to the blacklist.
      Returns:
      The builder object itself.
    • blackList

      @NotNull public @NotNull SlotIterator.Builder blackList(@NotNull @NotNull List<Integer> slots)
      This can be used to block multiple slots.
      Parameters:
      slots - The slots to be used for the inventory.
      Returns:
      The builder object itself.
    • blackList

      @NotNull public @NotNull SlotIterator.Builder blackList(int @NotNull ... slots)
      This can be used to block multiple slots.
      Parameters:
      slots - The slots to be used for the inventory.
      Returns:
      The builder object itself.
    • endPosition

      @NotNull public @NotNull SlotIterator.Builder endPosition(@Nonnegative int slot)
      This tells us where the item should stop.
      Parameters:
      slot - The slot to stop at.
      Returns:
      The Builder object itself.

      If this method is used, Pagination.setItemsPerPage(int) is ignored.

    • endPosition

      @NotNull public @NotNull SlotIterator.Builder endPosition(@Nonnegative int row, @Nonnegative int column)
      This tells us where the item should stop.
      Parameters:
      row - The row to stop at.
      column - The column to stop at.
      Returns:
      The Builder object itself.

      If this method is used, Pagination.setItemsPerPage(int) is ignored.

    • startPosition

      @NotNull public @NotNull SlotIterator.Builder startPosition(@Nonnegative int startSlot)
      Sets the slot to start at.
      Parameters:
      startSlot - The slot to start at.
      Returns:
      The Builder object itself.
    • startPosition

      @NotNull public @NotNull SlotIterator.Builder startPosition(@Nonnegative int row, @Nonnegative int column)
      Sets the slot to start at.
      Parameters:
      row - The row to start at.
      column - The column to start at.
      Returns:
      The Builder object itself.
    • withPattern

      @NotNull public @NotNull SlotIterator.Builder withPattern(@NotNull @NotNull SlotIteratorPattern builder)
      Using this method, you can decide for yourself how the items should be placed in the inventory.

      This method has higher priority than #startPosition and #type. If both are used, this method is preferred.

      Parameters:
      builder - The SlotIteratorPattern to use.
      Returns:
      The Builder object itself.
    • type

      @NotNull public @NotNull SlotIterator.Builder type(@NotNull @NotNull SlotIterator.SlotIteratorType type)
      This tells us whether the items should be placed vertically or horizontally.
      Parameters:
      type - The type of the iterator.
      Returns:
      The builder object itself.
    • override

      @NotNull public @NotNull SlotIterator.Builder override()
      This is used to overwrite items.
      Returns:
      The Builder object itself.
    • build

      public SlotIterator build()