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 aSubtaskContextrecord 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 thecreationRequestrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable Throwableerror()@Nullable SubtaskExecutionContextReturns the value of theexecutionContextrecord component.final inthashCode()Returns a hash code value for this object.@Nullable Objectresult()taskId()taskStarted(Future<?> job, Duration maxWaitTime) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SubtaskContext
public SubtaskContext(SubtaskCreationRequest<Request> creationRequest, @Nullable SubtaskExecutionContext executionContext) Creates an instance of aSubtaskContextrecord class.- Parameters:
creationRequest- the value for thecreationRequestrecord componentexecutionContext- the value for theexecutionContextrecord 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 thecreationRequestrecord component.- Returns:
- the value of the
creationRequestrecord component
-
executionContext
Returns the value of theexecutionContextrecord component.- Returns:
- the value of the
executionContextrecord component
-