Package org.springframework.hateoas
Class PagedModel.PageMetadata
java.lang.Object
org.springframework.hateoas.PagedModel.PageMetadata
- Enclosing class:
- PagedModel<T>
Value object for pagination metadata.
- Author:
- Oliver Gierke
-
Constructor Summary
ModifierConstructorDescriptionprotected
PageMetadata
(long size, long number, long totalElements) Creates a newPagedModel.PageMetadata
from the given size, number and total elements.PageMetadata
(long size, long number, long totalElements, long totalPages) Creates a newPagedModel.PageMetadata
from the given size, number, total elements and total pages. -
Method Summary
-
Constructor Details
-
PageMetadata
protected PageMetadata() -
PageMetadata
public PageMetadata(long size, long number, long totalElements, long totalPages) Creates a newPagedModel.PageMetadata
from the given size, number, total elements and total pages.- Parameters:
size
-number
- zero-indexed, must be less than totalPagestotalElements
-totalPages
-
-
PageMetadata
public PageMetadata(long size, long number, long totalElements) Creates a newPagedModel.PageMetadata
from the given size, number and total elements.- Parameters:
size
- the size of the pagenumber
- the number of the pagetotalElements
- the total number of elements available
-
-
Method Details
-
getSize
public long getSize()Returns the requested size of the page.- Returns:
- the size a positive long.
-
getTotalElements
public long getTotalElements()Returns the total number of elements available.- Returns:
- the totalElements a positive long.
-
getTotalPages
public long getTotalPages()Returns how many pages are available in total.- Returns:
- the totalPages a positive long.
-
getNumber
public long getNumber()Returns the number of the current page.- Returns:
- the number a positive long.
-
toString
-
equals
-
hashCode
public int hashCode()
-