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 classThis mutable adapter class is used to unmarshal JSON/XML using Jackson and build a resulting immutable object.(package private) static classThis adapter is called by JAXB when a class -- like the PageableDTO -- declares a XmlJavaTypeAdapter to handle marshaling and demarshaling through a facade object.static classThis adapter is called by Jackson to marshal the unmutable PageableDTO. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.util.UriBuilderaddQueryParams(org.springframework.web.util.UriBuilder uriBuilder) static PageableDTOfromPageable(org.springframework.data.domain.Pageable pageable) booleanbooleanisPaged()booleanisSorted()booleannext()static PageableDTOstatic PageableDTOstatic PageableDTOstatic PageableDTOof(org.springframework.data.domain.Pageable pageable) previous()org.springframework.data.domain.Pageableorg.springframework.data.domain.SorttoSort()toString()static PageableDTOunpaged()
-
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
-