java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.ast.source.PaginateEntry
Record Components:
logicalName - the pagination role ("limit", "offset", "page", or "pagesize"); must not be blank
paramName - the actual URL query-parameter name sent in the request; must not be blank
defaultValue - the value used when the query contains no LIMIT / OFFSET node; absent means the parameter is omitted

public record PaginateEntry(String logicalName, String paramName, Optional<Long> defaultValue) extends Record
Maps a logical pagination concept to a URL query parameter.

Recognised logical names and their typical uses:

  • "limit" — maximum number of rows per page.
  • "offset" — zero-based row offset (for offset-based APIs).
  • "page" — one-based page number (for page-based APIs).
  • "pagesize" — rows per page (for page-based APIs).

Syntax: limit: query("limit") [default: 100]

  • Constructor Details

    • PaginateEntry

      public PaginateEntry(String logicalName, String paramName, Optional<Long> defaultValue)
      Creates an instance of a PaginateEntry record class.
      Parameters:
      logicalName - the value for the logicalName record component
      paramName - the value for the paramName record component
      defaultValue - the value for the defaultValue record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • logicalName

      public String logicalName()
      Returns the value of the logicalName record component.
      Returns:
      the value of the logicalName record component
    • paramName

      public String paramName()
      Returns the value of the paramName record component.
      Returns:
      the value of the paramName record component
    • defaultValue

      public Optional<Long> defaultValue()
      Returns the value of the defaultValue record component.
      Returns:
      the value of the defaultValue record component