Package org.qubership.atp.ram.utils
Class ListUtils
java.lang.Object
org.qubership.atp.ram.utils.ListUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T> applyPagination(List<T> data, Integer page, Integer size) Applies pagination to list of data with type T.static <T> List<T> applyPagination(List<T> data, Integer page, Integer size, Integer shift) Applies pagination to list of data with type T.static <T> List<T> applyPaginationByIndexes(List<T> data, Integer startIndex, Integer endIndex) Applies pagination to list of data with type T.
-
Constructor Details
-
ListUtils
public ListUtils()
-
-
Method Details
-
applyPagination
Applies pagination to list of data with type T.- Type Parameters:
T- type of data- Parameters:
data- list of datapage- number of page for paginationsize- count of items at 1 page- Returns:
- Paginated list of data
-
applyPagination
Applies pagination to list of data with type T.- Type Parameters:
T- type of data- Parameters:
data- list of datapage- number of page for paginationsize- count of items at 1 page- Returns:
- Paginated list of data
-
applyPaginationByIndexes
public static <T> List<T> applyPaginationByIndexes(List<T> data, Integer startIndex, Integer endIndex) Applies pagination to list of data with type T.- Type Parameters:
T- type of data- Parameters:
data- list of datastartIndex- start indexendIndex- end index- Returns:
- Paginated list of data
-