Package com.helixframework.api.contract
Class BidiCursorPaginatedResponse<T>
java.lang.Object
com.helixframework.api.contract.BidiCursorPaginatedResponse<T>
- Type Parameters:
T- item type
API response that returns a collection with bi-directional cursor pagination.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofBidiCursorPaginatedResponse.BidiCursorPaginatedResponse(String nextCursor, String previousCursor, Boolean hasNext, Boolean hasPrevious, Collection<T> items) Creates a new instance ofBidiCursorPaginatedResponse.BidiCursorPaginatedResponse(String nextCursor, String previousCursor, Collection<T> items) Creates a new instance ofBidiCursorPaginatedResponse. -
Method Summary
Modifier and TypeMethodDescriptionintgetCount()Gets the number of items in the collection.getItems()Gets the items.Gets the next page cursor.Gets the previous page cursor.hasNext()Optional flag indicating whether there are more items after the current cursor.Optional flag indicating whether there are more items before the current cursor.
-
Constructor Details
-
BidiCursorPaginatedResponse
public BidiCursorPaginatedResponse()Creates a new instance ofBidiCursorPaginatedResponse. -
BidiCursorPaginatedResponse
Creates a new instance ofBidiCursorPaginatedResponse.- Parameters:
nextCursor- next page cursorpreviousCursor- previous page cursoritems- items
-
BidiCursorPaginatedResponse
public BidiCursorPaginatedResponse(String nextCursor, String previousCursor, Boolean hasNext, Boolean hasPrevious, Collection<T> items) Creates a new instance ofBidiCursorPaginatedResponse.- Parameters:
nextCursor- next page cursorpreviousCursor- previous page cursorhasNext- flag indicating whether items exist after the current cursorhasPrevious- flag indicating whether items exist before the current cursoritems- items
-
-
Method Details
-
getCount
public int getCount()Gets the number of items in the collection.- Returns:
- number of items in collection
-
getNextCursor
Gets the next page cursor.- Returns:
- next page cursor
-
getPreviousCursor
Gets the previous page cursor.- Returns:
- previous page cursor
-
hasNext
Optional flag indicating whether there are more items after the current cursor.- Returns:
trueif there are items after the current cursor; otherwisefalse
-
hasPrevious
Optional flag indicating whether there are more items before the current cursor.- Returns:
trueif there are items before the current cursor; otherwisefalse
-
getItems
Gets the items.- Returns:
- items
-