Class ListUtils
java.lang.Object
org.nuxeo.ecm.core.opencmis.impl.util.ListUtils
Utilities around lists.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A holder for a sublist of a list, a flag indicating if there were more elements after the included sublist, and the total number of items if there had been no batching. -
Method Summary
Modifier and TypeMethodDescriptionstatic <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.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.
-
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 listmaxItems
- the maximum number of items, ornull
for the defaultskipCount
- the skip countdefaultMax
- the default maximum number of items ifmaxItems
isnull
- 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 listmaxItems
- the maximum number of items, ornull
for the defaultskipCount
- the skip countdefaultMax
- the default maximum number of items ifmaxItems
isnull
- Returns:
- the batched list, which may be a sublist per
List.subList(int, int)
-