Record Class ListTasksResult

java.lang.Object
java.lang.Record
org.a2aproject.sdk.jsonrpc.common.wrappers.ListTasksResult
Record Components:
tasks - Array of tasks matching the specified criteria
totalSize - Total number of tasks available (before pagination)
pageSize - Number of tasks returned in this response
nextPageToken - Token for retrieving the next page of results (null if no more results)

public record ListTasksResult(List<org.a2aproject.sdk.spec.Task> tasks, int totalSize, int pageSize, @Nullable String nextPageToken) extends Record
Result of a list tasks request containing matching tasks and pagination information.
  • Constructor Details

    • ListTasksResult

      public ListTasksResult(List<org.a2aproject.sdk.spec.Task> tasks, int totalSize, int pageSize, @Nullable String nextPageToken)
      Compact constructor for validation. Validates parameters and creates a defensive copy of the tasks list.
      Parameters:
      tasks - the list of tasks
      totalSize - total number of tasks available
      pageSize - number of tasks in this page
      nextPageToken - token for next page
      Throws:
      IllegalArgumentException - if validation fails
    • ListTasksResult

      public ListTasksResult(List<org.a2aproject.sdk.spec.Task> tasks)
      Constructor for results without pagination.
      Parameters:
      tasks - the list of tasks
  • Method Details

    • hasMoreResults

      public boolean hasMoreResults()
      Returns whether there are more results available.
      Returns:
      true if there are more pages of results
    • builder

      public static ListTasksResult.Builder builder()
      Create a new Builder
      Returns:
      the builder
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • tasks

      public List<org.a2aproject.sdk.spec.Task> tasks()
      Returns the value of the tasks record component.
      Returns:
      the value of the tasks record component
    • totalSize

      public int totalSize()
      Returns the value of the totalSize record component.
      Returns:
      the value of the totalSize record component
    • pageSize

      public int pageSize()
      Returns the value of the pageSize record component.
      Returns:
      the value of the pageSize record component
    • nextPageToken

      public @Nullable String nextPageToken()
      Returns the value of the nextPageToken record component.
      Returns:
      the value of the nextPageToken record component