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)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing instances. -
Constructor Summary
ConstructorsConstructorDescriptionListTasksResult(List<Task> tasks) Constructor for results without pagination.ListTasksResult(List<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.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<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
-
-
Method Details
-
hasMoreResults
public boolean hasMoreResults()Returns whether there are more results available.- Returns:
- true if there are more pages of results
-
builder
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
tasks
-
totalSize
-
pageSize
-
nextPageToken
Returns the value of thenextPageTokenrecord component.- Returns:
- the value of the
nextPageTokenrecord component
-