Package com.helixframework.api.contract
Class HateoasBidiCursorPaginatedResponse<T>
java.lang.Object
com.helixframework.api.contract.HateoasResponse
com.helixframework.api.contract.HateoasBidiCursorPaginatedResponse<T>
- Type Parameters:
T- item type
API response that returns a collection with bi-directional cursor pagination and HATEOAS links.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance ofHateoasBidiCursorPaginatedResponse.HateoasBidiCursorPaginatedResponse(String nextCursor, String previousCursor, Boolean hasNext, Boolean hasPrevious, Collection<T> items) Creates a new instance ofHateoasBidiCursorPaginatedResponse.HateoasBidiCursorPaginatedResponse(String nextCursor, String previousCursor, Collection<T> items) Creates a new instance ofHateoasBidiCursorPaginatedResponse. -
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
-
HateoasBidiCursorPaginatedResponse
public HateoasBidiCursorPaginatedResponse()Creates a new instance ofHateoasBidiCursorPaginatedResponse. -
HateoasBidiCursorPaginatedResponse
public HateoasBidiCursorPaginatedResponse(String nextCursor, String previousCursor, Collection<T> items) Creates a new instance ofHateoasBidiCursorPaginatedResponse.- Parameters:
nextCursor- next page cursorpreviousCursor- previous page cursoritems- items
-
HateoasBidiCursorPaginatedResponse
public HateoasBidiCursorPaginatedResponse(String nextCursor, String previousCursor, Boolean hasNext, Boolean hasPrevious, Collection<T> items) Creates a new instance ofHateoasBidiCursorPaginatedResponse.- 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
-