Record Class PaginateSpec
java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.ast.source.PaginateSpec
- Record Components:
entries- the pagination parameter mappings; must not be null or empty
Declares how an HTTP source's pagination maps to URL parameters.
When the query planner encounters a LimitNode or infers offset
information, it consults this spec to construct the correct URL parameters.
Syntax (offset-based API):
paginate: {
limit: query("limit") [default: 100],
offset: query("offset") [default: 0]
}
Syntax (page-based API):
paginate: {
page: query("page") [default: 1],
pagesize: query("per_page") [default: 50]
}
-
Constructor Summary
ConstructorsConstructorDescriptionPaginateSpec(List<PaginateEntry> entries) Creates an instance of aPaginateSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionentries()Returns the value of theentriesrecord component.Finds the entry with the given logical name (e.g.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PaginateSpec
Creates an instance of aPaginateSpecrecord class.- Parameters:
entries- the value for theentriesrecord component
-
-
Method Details
-
entry
Finds the entry with the given logical name (e.g."limit").- Parameters:
logicalName- the logical name to search for- Returns:
- the matching entry, or empty if not declared
-
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 withObjects::equals(Object,Object). -
entries
Returns the value of theentriesrecord component.- Returns:
- the value of the
entriesrecord component
-