Package org.springframework.data.web
Record Class PagedModel.PageMetadata
java.lang.Object
java.lang.Record
org.springframework.data.web.PagedModel.PageMetadata
- Enclosing class:
- PagedModel<T>
public static record PagedModel.PageMetadata(long size, long number, long totalElements, long totalPages)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPageMetadata(long size, long number, long totalElements, long totalPages) Creates an instance of aPageMetadatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longnumber()Returns the value of thenumberrecord component.longsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalElementsrecord component.longReturns the value of thetotalPagesrecord component.
-
Constructor Details
-
PageMetadata
public PageMetadata(long size, long number, long totalElements, long totalPages) Creates an instance of aPageMetadatarecord class.- Parameters:
size- the value for thesizerecord componentnumber- the value for thenumberrecord componenttotalElements- the value for thetotalElementsrecord componenttotalPages- the value for thetotalPagesrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
size
public long size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
number
public long number()Returns the value of thenumberrecord component.- Returns:
- the value of the
numberrecord component
-
totalElements
public long totalElements()Returns the value of thetotalElementsrecord component.- Returns:
- the value of the
totalElementsrecord component
-
totalPages
public long totalPages()Returns the value of thetotalPagesrecord component.- Returns:
- the value of the
totalPagesrecord component
-