public class PagingUtils extends Object
Utilities for handling Strava paging
| Constructor and Description |
|---|
PagingUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<Paging> |
convertToStravaPaging(Paging inputPaging)
Utility method - give it any paging instruction and it will return a list of paging instructions that will work with the Strava API (i.e.
|
static <T> List<T> |
ignoreFirstN(List<T> list,
int ignoreFirstN)
Removes the first N items from a list
|
static <T> List<T> |
ignoreLastN(List<T> list,
int ignoreLastN)
Removes the last ignoreLastN items from the list
|
static void |
validatePagingArguments(Paging pagingInstruction)
Throw an IllegalArgumentException if the page or perPage parameters are set but are invalid
|
public static List<Paging> convertToStravaPaging(Paging inputPaging)
Utility method - give it any paging instruction and it will return a list of paging instructions that will work with the Strava API (i.e. that conform to maximum page sizes etc.)
inputPaging - The paging instruction to be convertedpublic static <T> List<T> ignoreLastN(List<T> list, int ignoreLastN)
Removes the last ignoreLastN items from the list
T - The class of the objects contained in the listlist - List of itemsignoreLastN - Number of items to removepublic static <T> List<T> ignoreFirstN(List<T> list, int ignoreFirstN)
Removes the first N items from a list
T - The class of object in the listlist - List of itemsignoreFirstN - Number of items to removepublic static void validatePagingArguments(Paging pagingInstruction)
Throw an IllegalArgumentException if the page or perPage parameters are set but are invalid
pagingInstruction - The page to be returnedCopyright © 2015 Dan Shannon. All rights reserved.