Interface ListCompatWrapper

All Superinterfaces:
CompatWrapper
All Known Implementing Classes:
ListCompatWrapper_Java_17, ListCompatWrapper_Java_21

public interface ListCompatWrapper extends CompatWrapper
  • Method Summary

    Modifier and Type
    Method
    Description
    default <E> E
    getFirst(List<E> list)
    Gets the first element of a list.
    default <E> E
    getLast(List<E> list)
    Gets the last element of a list.
    default <E> E
    removeFirst(List<E> list)
    Removes and returns the first element of a list.
    default <E> E
    removeLast(List<E> list)
    Removes and returns the last element of a list.

    Methods inherited from interface net.thomilist.dimensionalinventories.compatibility.CompatWrapper

    onServerStarted
  • Method Details

    • getFirst

      default <E> E getFirst(List<E> list)
      Gets the first element of a list.
      Type Parameters:
      E - the type of elements in the list
      Parameters:
      list - the list to get the first element from
      Returns:
      the retrieved element
      Throws:
      NoSuchElementException - if the list is empty
    • getLast

      default <E> E getLast(List<E> list)
      Gets the last element of a list.
      Type Parameters:
      E - the type of elements in the list
      Parameters:
      list - the list to get the last element from
      Returns:
      the retrieved element
      Throws:
      NoSuchElementException - if the list is empty
    • removeFirst

      default <E> E removeFirst(List<E> list)
      Removes and returns the first element of a list.
      Type Parameters:
      E - the type of elements in the list
      Parameters:
      list - the list to remove the first element from
      Returns:
      the removed element
      Throws:
      NoSuchElementException - if the list is empty
    • removeLast

      default <E> E removeLast(List<E> list)
      Removes and returns the last element of a list.
      Type Parameters:
      E - the type of elements in the list
      Parameters:
      list - the list to remove the last element from
      Returns:
      the removed element
      Throws:
      NoSuchElementException - if the list is empty