Class PaginationUtils
- java.lang.Object
-
- org.craftercms.studio.impl.v2.utils.PaginationUtils
-
public class PaginationUtils extends Object
Utility class with methods for pagination.- Author:
- avasquez
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>
paginate(List<T> list, int offset, int limit, String sortBy)
Performs pagination on thelist
, returning from the specifiedoffset
to the specifiedlimit
.
-
-
-
Method Detail
-
paginate
public static <T> List<T> paginate(List<T> list, int offset, int limit, String sortBy)
Performs pagination on thelist
, returning from the specifiedoffset
to the specifiedlimit
. The list can also be sorted by thesortBy
(optional).- Parameters:
list
- the list to paginateoffset
- the offset from where to startlimit
- the max number of elements that the paginated list should includesortBy
- the property used for sorting- Returns:
- the paginated list
-
-