Annotation Type SortDefault


@Retention(RUNTIME) @Target(PARAMETER) public @interface SortDefault
Annotation, heavily inspired by Spring Data's SortDefault, for configuring the Pageable sort default values to use when no query parameters are given.
Since:
1.2.0
Author:
Christian Beikov
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Wrapper annotation to allow declaring multiple SortDefault annotations on a method parameter.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The sort direction to use for sort of a Pageable when no sort direction is defined for a path.
    The null handling to use for sort of a Pageable when no null handling is defined for a path.
    The paths to use for sort of a Pageable when no sort query parameter is defined.
  • Element Details

    • sort

      String[] sort
      The paths to use for sort of a Pageable when no sort query parameter is defined.
      Returns:
      The default paths to sort by
      Default:
      {}
    • direction

      Sort.Direction direction
      The sort direction to use for sort of a Pageable when no sort direction is defined for a path. Defaults to Sort.Direction.ASC.
      Returns:
      The default direction to sort by
      Default:
      ASC
    • nulls

      The null handling to use for sort of a Pageable when no null handling is defined for a path. Defaults to Sort.NullHandling.NATIVE.
      Returns:
      The default null handling to use for sorting
      Default:
      NATIVE