@Configurable public class OffsetBasedPagingMetadata<T> extends Object implements PagingMetadata
It generates result for example in JSON:
{ "first": true, "last": true, "number": 1, "size": 20, "totalPages": 1, "totalElements": 1, "sort": [ "null" ], "numberOfElements": 1 }
Constructor and Description |
---|
OffsetBasedPagingMetadata(org.springframework.data.domain.Page<T> data) |
Modifier and Type | Method and Description |
---|---|
int |
getNumber()
Returns the number of the current
Page . |
int |
getNumberOfElements()
Returns the number of elements currently on this
Page . |
int |
getSize()
Returns the size of the
Page . |
org.springframework.data.domain.Sort |
getSort()
Returns the sorting parameters for the
Page . |
long |
getTotalElements()
Returns the total amount of elements.
|
int |
getTotalPages()
Returns the number of total pages.
|
boolean |
isFirst()
Returns whether the current
Page is the first one. |
boolean |
isLast()
Returns whether the current
Page is the last one. |
public OffsetBasedPagingMetadata(org.springframework.data.domain.Page<T> data)
public boolean isFirst()
Page
is the first one.public boolean isLast()
Page
is the last one.public int getNumber()
Page
. Is always non-negative.Page
.public int getSize()
Page
.Page
.public int getNumberOfElements()
Page
.Page
.public int getTotalPages()
public long getTotalElements()
public org.springframework.data.domain.Sort getSort()
Page
.Copyright © 2018 Pivotal Software, Inc.. All rights reserved.