Class DefaultedPageable

java.lang.Object
org.springframework.data.rest.webmvc.support.DefaultedPageable

public final class DefaultedPageable extends Object
Value object to capture a Pageable as well whether it is the default one configured.
Author:
Oliver Gierke
  • Constructor Summary

    Constructors
    Constructor
    Description
    DefaultedPageable(org.springframework.data.domain.Pageable pageable, boolean isDefault)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    org.springframework.data.domain.Pageable
    Returns the delegate Pageable.
    int
     
    boolean
    Returns whether the contained Pageable is the default one configured.
     
    org.springframework.data.domain.Pageable
    Returns Pageable.unpaged() if the contained Pageable is the default one.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DefaultedPageable

      public DefaultedPageable(org.springframework.data.domain.Pageable pageable, boolean isDefault)
  • Method Details

    • getPageable

      public org.springframework.data.domain.Pageable getPageable()
      Returns the delegate Pageable.
      Returns:
      can be null.
    • isDefault

      public boolean isDefault()
      Returns whether the contained Pageable is the default one configured.
      Returns:
      the isDefault
    • unpagedIfDefault

      public org.springframework.data.domain.Pageable unpagedIfDefault()
      Returns Pageable.unpaged() if the contained Pageable is the default one.
      Returns:
      will never be null.
      Since:
      3.3
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object