Annotation Type PaginationCursor


@Target(PARAMETER) @Retention(RUNTIME) public @interface PaginationCursor
Marks a parameter - already annotated @QueryParam/@PathParam/ @HeaderParam/@Body - as the carrier a @Paginated fetch re-populates with the freshly extracted next-page pointer before every subsequent call. On the first call, the consumer's own argument is used verbatim. See docs/design/pagination-helper.md §6.3 - reuses RIP's existing carrier vocabulary instead of inventing four new parameter annotations.
 @GET("/orders")
 @Paginated(itemsField = "orders", pointerField = "next_cursor")
 Page<Order> listOrders(@QueryParam("cursor") @PaginationCursor String cursor);
 

Stacks on @QueryParam/@PathParam/@HeaderParam (a String, int, or long parameter) or on a @Body Map<String,Object> parameter, in which case bodyField() names the dotted path inside that map to write the extracted pointer value into - see §6.7 for why the carrier is a plain map rather than @Field. Every other field the caller put in the map on the first call carries forward unchanged on every subsequent page.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Dotted path inside a @Body Map<String,Object> to set the extracted pointer value into - only meaningful when stacked on @Body; ignored otherwise.
  • Element Details

    • bodyField

      String bodyField
      Dotted path inside a @Body Map<String,Object> to set the extracted pointer value into - only meaningful when stacked on @Body; ignored otherwise.
      Returns:
      the dotted path to set within the request body map
      Default:
      ""