Class ListUtils
- java.lang.Object
-
- org.nuxeo.ecm.core.opencmis.impl.util.ListUtils
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ListUtils.BatchedList<T>
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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 Detail
-
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)
-
-