Package org.a2aproject.sdk.util
Record Class PageToken
java.lang.Object
java.lang.Record
org.a2aproject.sdk.util.PageToken
- Record Components:
timestamp- The timestamp component of the page tokenid- The identifier component of the page token
Represents a pagination token for keyset-based pagination.
PageTokens use the format "timestamp_millis:id" where:
timestamp_millis- Unix timestamp in milliseconds (numeric)id- The entity identifier (String)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static @Nullable PageTokenfromString(@Nullable String tokenStr) Parses a pageToken string into a PageToken record.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of thetimestamprecord component.toString()Converts this PageToken to its string representation.
-
Constructor Details
-
Method Details
-
fromString
Parses a pageToken string into a PageToken record.Expected format:
"timestamp_millis:id"- Parameters:
tokenStr- The pageToken string to parse, may be null or empty- Returns:
- A PageToken instance, or null if tokenStr is null or empty
- Throws:
InvalidParamsError- if the token format is invalid or timestamp is not numeric
-
toString
Converts this PageToken to its string representation.Format:
"timestamp_millis:id" -
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). -
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-