Record Class SubtaskContext<Request>
java.lang.Object
java.lang.Record
com.javaaidev.agenticpatterns.parallelizationworkflow.SubtaskContext<Request>
- Type Parameters:
Request
- Request type- Record Components:
creationRequest
- Subtask creation requestexecutionContext
- Subtask execution context
public record SubtaskContext<Request>(SubtaskCreationRequest<Request> creationRequest, @Nullable SubtaskExecutionContext executionContext)
extends Record
Subtask context for management
-
Constructor Summary
ConstructorsConstructorDescriptionSubtaskContext
(SubtaskCreationRequest<Request> creationRequest, @Nullable SubtaskExecutionContext executionContext) Creates an instance of aSubtaskContext
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <Request> SubtaskContext
<Request> create
(SubtaskCreationRequest<Request> creationRequest) static <Request,
TaskRequest, TaskResponse>
SubtaskContext<Request> create
(String taskId, TaskExecutionAgent<TaskRequest, TaskResponse> task, Function<Request, TaskRequest> requestTransformer) Returns the value of thecreationRequest
record component.final boolean
Indicates whether some other object is "equal to" this one.@Nullable Throwable
error()
@Nullable SubtaskExecutionContext
Returns the value of theexecutionContext
record component.final int
hashCode()
Returns a hash code value for this object.@Nullable Object
result()
taskId()
taskStarted
(Future<?> job, Duration maxWaitTime) final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
SubtaskContext
public SubtaskContext(SubtaskCreationRequest<Request> creationRequest, @Nullable SubtaskExecutionContext executionContext) Creates an instance of aSubtaskContext
record class.- Parameters:
creationRequest
- the value for thecreationRequest
record componentexecutionContext
- the value for theexecutionContext
record component
-
-
Method Details
-
create
public static <Request,TaskRequest, SubtaskContext<Request> createTaskResponse> (String taskId, TaskExecutionAgent<TaskRequest, TaskResponse> task, Function<Request, TaskRequest> requestTransformer) -
create
public static <Request> SubtaskContext<Request> create(SubtaskCreationRequest<Request> creationRequest) -
taskStarted
-
collectResult
-
taskId
-
result
-
error
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
creationRequest
Returns the value of thecreationRequest
record component.- Returns:
- the value of the
creationRequest
record component
-
executionContext
Returns the value of theexecutionContext
record component.- Returns:
- the value of the
executionContext
record component
-