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
ConstructorDescriptionPageMetadata
(long size, long number, long totalElements, long totalPages) Creates an instance of aPageMetadata
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.long
number()
Returns the value of thenumber
record component.long
size()
Returns the value of thesize
record component.final String
toString()
Returns a string representation of this record class.long
Returns the value of thetotalElements
record component.long
Returns the value of thetotalPages
record component.
-
Constructor Details
-
PageMetadata
public PageMetadata(long size, long number, long totalElements, long totalPages) Creates an instance of aPageMetadata
record class.- Parameters:
size
- the value for thesize
record componentnumber
- the value for thenumber
record componenttotalElements
- the value for thetotalElements
record componenttotalPages
- the value for thetotalPages
record 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 thesize
record component.- Returns:
- the value of the
size
record component
-
number
public long number()Returns the value of thenumber
record component.- Returns:
- the value of the
number
record component
-
totalElements
public long totalElements()Returns the value of thetotalElements
record component.- Returns:
- the value of the
totalElements
record component
-
totalPages
public long totalPages()Returns the value of thetotalPages
record component.- Returns:
- the value of the
totalPages
record component
-