Class PageableBuilder

java.lang.Object
org.praxisplatform.uischema.util.PageableBuilder

public final class PageableBuilder extends Object
Utility for building Pageable instances from primitive request parameters while applying a fallback Sort when none is specified.
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.springframework.data.domain.Pageable
    from(int page, int size, List<String> sort, org.springframework.data.domain.Sort fallback)
    Compose a Pageable instance using the provided page, size and optional sort directives.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • from

      public static org.springframework.data.domain.Pageable from(int page, int size, List<String> sort, org.springframework.data.domain.Sort fallback)
      Compose a Pageable instance using the provided page, size and optional sort directives. When no sort is provided the fallback sort is applied.
      Parameters:
      page - zero-based page index
      size - page size
      sort - sort directives (e.g. ["name,asc", "id,desc"])
      fallback - default sort when sort is empty
      Returns:
      resulting Pageable