Class ListUtils

java.lang.Object
org.nuxeo.ecm.core.opencmis.impl.util.ListUtils

public class ListUtils extends Object
Utilities around lists.
  • Method Details

    • batchList

      public static <T> List<T> batchList(List<T> list, BigInteger maxItems, BigInteger skipCount, int defaultMax)
      Returns a batched version of the list, according to the passed parameters.
      Parameters:
      list - the list
      maxItems - the maximum number of items, or null for the default
      skipCount - the skip count
      defaultMax - the default maximum number of items if maxItems is null
      Returns:
      the batched list, which may be a sublist per List.subList(int, int)
    • getBatchedList

      public static <T> ListUtils.BatchedList<T> getBatchedList(List<T> list, BigInteger maxItems, BigInteger skipCount, int defaultMax)
      Returns a batched version of the list, according to the passed parameters.
      Parameters:
      list - the list
      maxItems - the maximum number of items, or null for the default
      skipCount - the skip count
      defaultMax - the default maximum number of items if maxItems is null
      Returns:
      the batched list, which may be a sublist per List.subList(int, int)