Class PagedModel<T>
java.lang.Object
com.broadleafcommerce.search.api.domain.PagedModel<T>
- Direct Known Subclasses:
SearchResponse
Broadleaf: Copy of Spring Data concept for possible use earlier than spring data commons 3.3.x
DTO to build stable JSON representations of a Spring Data
Page
. It can either be
selectively used in controller methods by calling new PagedModel<>(page)
or generally
activated as representation model for PageImpl
instances
by setting EnableSpringDataWebSupport
's
pageSerializationMode
to
EnableSpringDataWebSupport.PageSerializationMode.VIA_DTO
.- Author:
- Oliver Drotbohm, Greg Turnquist
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPagedModel
(org.springframework.data.domain.Page<T> page, org.springframework.data.domain.Pageable pageable) Creates a newPagedModel
for the givenPage
. -
Method Summary
-
Constructor Details
-
PagedModel
public PagedModel(org.springframework.data.domain.Page<T> page, org.springframework.data.domain.Pageable pageable) Creates a newPagedModel
for the givenPage
.- Parameters:
page
- must not be null.
-
-
Method Details
-
getContent
-
getSize
public int getSize() -
getNumber
public int getNumber() -
getNumberOfElements
public int getNumberOfElements() -
isFirst
public boolean isFirst() -
isLast
public boolean isLast() -
getTotalElements
public long getTotalElements() -
getTotalPages
public long getTotalPages() -
isEmpty
public boolean isEmpty() -
getMetadata
-
equals
-
hashCode
public int hashCode()
-