Class OffsetPageRequest

  • All Implemented Interfaces:
    Serializable, org.springframework.data.domain.Pageable

    public class OffsetPageRequest
    extends Object
    implements org.springframework.data.domain.Pageable, Serializable
    Pageable implementation using limit-offset mode.
    See Also:
    Serialized Form
    • Field Detail

      • maxLimit

        private int maxLimit
      • propertyDelimiter

        private String propertyDelimiter
      • limit

        private int limit
      • offset

        private long offset
      • sort

        private org.springframework.data.domain.Sort sort
    • Constructor Detail

      • OffsetPageRequest

        public OffsetPageRequest()
      • OffsetPageRequest

        public OffsetPageRequest​(int limit,
                                 long offset)
      • OffsetPageRequest

        public OffsetPageRequest​(int limit,
                                 long offset,
                                 org.springframework.data.domain.Sort sort)
    • Method Detail

      • of

        public static OffsetPageRequest of​(int limit,
                                           long offset,
                                           org.springframework.data.domain.Sort sort)
      • defaultSort

        public OffsetPageRequest defaultSort​(org.springframework.data.domain.Sort.Direction direction,
                                             String... properties)
      • setLimit

        @QueryParam("limit")
        @DefaultValue("10")
        public void setLimit​(int limit)
        Sets limit.
        Parameters:
        limit - the size of the page to be returned.
      • setOffset

        @QueryParam("offset")
        @DefaultValue("0")
        public void setOffset​(long offset)
        Sets offset.
        Parameters:
        offset - number of records to be skipped from the result set.
      • setSort

        @QueryParam("sort[]")
        public void setSort​(List<String> sorts)
        Sets sorts.
        Parameters:
        sorts - the sorting strings. One sorting string is a comma separated string of property and direction, such as property,asc, property,desc.
      • getPageNumber

        public int getPageNumber()
        Specified by:
        getPageNumber in interface org.springframework.data.domain.Pageable
      • getPageSize

        public int getPageSize()
        Specified by:
        getPageSize in interface org.springframework.data.domain.Pageable
      • getOffset

        public long getOffset()
        Specified by:
        getOffset in interface org.springframework.data.domain.Pageable
      • getSort

        public org.springframework.data.domain.Sort getSort()
        Specified by:
        getSort in interface org.springframework.data.domain.Pageable
      • next

        public OffsetPageRequest next()
        Specified by:
        next in interface org.springframework.data.domain.Pageable
      • previousOrFirst

        public OffsetPageRequest previousOrFirst()
        Specified by:
        previousOrFirst in interface org.springframework.data.domain.Pageable
      • first

        public OffsetPageRequest first()
        Specified by:
        first in interface org.springframework.data.domain.Pageable
      • withPage

        public OffsetPageRequest withPage​(int pageNumber)
        Specified by:
        withPage in interface org.springframework.data.domain.Pageable
      • hasPrevious

        public boolean hasPrevious()
        Specified by:
        hasPrevious in interface org.springframework.data.domain.Pageable
      • getMaxLimit

        protected int getMaxLimit()
      • getPropertyDelimiter

        protected String getPropertyDelimiter()
      • filterProperty

        protected String filterProperty​(String property)
      • parseDirection

        protected Optional<org.springframework.data.domain.Sort.Direction> parseDirection​(String value)
      • parseOrders

        protected List<org.springframework.data.domain.Sort.Order> parseOrders​(List<String> source)
      • parseSort

        protected org.springframework.data.domain.Sort parseSort​(List<String> sorts)
      • check

        private void check​(int limit)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object