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 criteriatotalSize- Total number of tasks available (before pagination)pageSize- Number of tasks returned in this responsenextPageToken- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing instances. -
Constructor Summary
ConstructorsConstructorDescriptionListTasksResult(List<org.a2aproject.sdk.spec.Task> tasks) Constructor for results without pagination.ListTasksResult(List<org.a2aproject.sdk.spec.Task> tasks, int totalSize, int pageSize, @Nullable String nextPageToken) Compact constructor for validation. -
Method Summary
Modifier and TypeMethodDescriptionstatic ListTasksResult.Builderbuilder()Create a new Builderfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns whether there are more results available.@Nullable StringReturns the value of thenextPageTokenrecord component.intpageSize()Returns the value of thepageSizerecord component.List<org.a2aproject.sdk.spec.Task>tasks()Returns the value of thetasksrecord component.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalSizerecord component.
-
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 taskstotalSize- total number of tasks availablepageSize- number of tasks in this pagenextPageToken- token for next page- Throws:
IllegalArgumentException- if validation fails
-
ListTasksResult
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
Create a new Builder- Returns:
- the builder
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
tasks
Returns the value of thetasksrecord component.- Returns:
- the value of the
tasksrecord component
-
totalSize
public int totalSize()Returns the value of thetotalSizerecord component.- Returns:
- the value of the
totalSizerecord component
-
pageSize
public int pageSize()Returns the value of thepageSizerecord component.- Returns:
- the value of the
pageSizerecord component
-
nextPageToken
Returns the value of thenextPageTokenrecord component.- Returns:
- the value of the
nextPageTokenrecord component
-