java.lang.Object
org.eclipse.milo.opcua.stack.core.util.Lists

public final class Lists extends Object
  • Method Details

    • ofNullable

      @SafeVarargs public static <T> List<T> ofNullable(@Nullable T... elements)
      Return an unmodifiable list containing the given elements.

      This is a null-safe variation of List.of().

      Parameters:
      elements - the elements to include in the list.
      Returns:
      an unmodifiable list containing the given elements.
    • partition

      public static <T> Stream<List<T>> partition(List<T> source, int partitionSize)
      Partition source into one or more Lists of maximum size indicated partitionSize.
      Parameters:
      source - the List to partition.
      partitionSize - the maximum size of each partition.
      Returns:
      a Stream of Lists, each no larger than partitionSize.