Class PageableDTO
java.lang.Object
info.ejava.examples.common.dto.paging.PageableDTO
This class is responsible for serializing and deserializing a Spring Data Pageable
object to/from an API. It has been mapped using Jackson JSON and XML, with a little
JAXB to get it to work with WebFlux. It is designed to be an immutable object -- thus
the mapping challenge is to have all properties known prior to construction.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This mutable adapter class is used to unmarshal JSON/XML using Jackson and build a resulting immutable object.(package private) static class
This adapter is called by JAXB when a class -- like the PageableDTO -- declares a XmlJavaTypeAdapter to handle marshaling and demarshaling through a facade object.static class
This adapter is called by Jackson to marshal the unmutable PageableDTO. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.util.UriBuilder
addQueryParams
(org.springframework.web.util.UriBuilder uriBuilder) static PageableDTO
fromPageable
(org.springframework.data.domain.Pageable pageable) boolean
boolean
isPaged()
boolean
isSorted()
boolean
next()
static PageableDTO
static PageableDTO
static PageableDTO
static PageableDTO
of
(org.springframework.data.domain.Pageable pageable) previous()
org.springframework.data.domain.Pageable
org.springframework.data.domain.Sort
toSort()
toString()
static PageableDTO
unpaged()
-
Field Details
-
PAGE_NUMBER
- See Also:
-
PAGE_SIZE
- See Also:
-
SORT
- See Also:
-
pageNumber
-
pageSize
-
sortString
-
-
Constructor Details
-
PageableDTO
-
-
Method Details
-
unpaged
-
of
-
of
public static PageableDTO of(Integer pageNumber, Integer pageSize, org.springframework.data.domain.Sort sort) -
of
-
of
-
next
-
previous
-
isUnpaged
public boolean isUnpaged() -
isPaged
public boolean isPaged() -
isSorted
public boolean isSorted() -
hasPrevious
public boolean hasPrevious() -
addQueryParams
public org.springframework.web.util.UriBuilder addQueryParams(org.springframework.web.util.UriBuilder uriBuilder) -
getQueryParams
-
fromPageable
-
toPageable
public org.springframework.data.domain.Pageable toPageable() -
toSort
public org.springframework.data.domain.Sort toSort() -
toString
-
toDtoFacade
-