Annotation Interface PageableDefault


@Documented @Retention(RUNTIME) @Target(PARAMETER) public @interface PageableDefault
Annotation to set defaults when injecting a Pageable into a controller method. Instead of configuring sort() and direction() you can also use SortDefault or SortDefault.SortDefaults.
Since:
1.6
Author:
Oliver Gierke
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The direction to sort by.
    int
    The default-pagenumber the injected Pageable should get if no corresponding parameter defined in request (default is 0).
    int
    The default-size the injected Pageable should get if no corresponding parameter defined in request (default is 10).
    The properties to sort by by default.
    int
    Alias for size().
  • Element Details

    • value

      int value
      Alias for size(). Prefer to use the size() method as it makes the annotation declaration more expressive and you'll probably want to configure the page() anyway.
      Returns:
      Default:
      10
    • size

      int size
      The default-size the injected Pageable should get if no corresponding parameter defined in request (default is 10).
      Default:
      10
    • page

      int page
      The default-pagenumber the injected Pageable should get if no corresponding parameter defined in request (default is 0).
      Default:
      0
    • sort

      String[] sort
      The properties to sort by by default. If unset, no sorting will be applied at all.
      Returns:
      Default:
      {}
    • direction

      Sort.Direction direction
      The direction to sort by. Defaults to Sort.Direction.ASC.
      Returns:
      Default:
      ASC