Package akka.javasdk.agent.task
Record Class TaskSnapshot<R>
- Type Parameters:
R- The result type of the task.
public record TaskSnapshot<R>(String name, String description, String instructions, TaskStatus status, Optional<R> result, Optional<String> failureReason)
extends Record
A point-in-time snapshot of a task's state, with a typed result.
-
Constructor Summary
ConstructorsConstructorDescriptionTaskSnapshot(String name, String description, String instructions, TaskStatus status, Optional<R> result, Optional<String> failureReason) Creates an instance of aTaskSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefailureReasonrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinstructionsrecord component.name()Returns the value of thenamerecord component.result()Returns the value of theresultrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TaskSnapshot
public TaskSnapshot(String name, String description, String instructions, TaskStatus status, Optional<R> result, Optional<String> failureReason) Creates an instance of aTaskSnapshotrecord class.- Parameters:
name- the value for thenamerecord componentdescription- the value for thedescriptionrecord componentinstructions- the value for theinstructionsrecord componentstatus- the value for thestatusrecord componentresult- the value for theresultrecord componentfailureReason- the value for thefailureReasonrecord component
-
-
Method Details
-
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). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
instructions
Returns the value of theinstructionsrecord component.- Returns:
- the value of the
instructionsrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
failureReason
Returns the value of thefailureReasonrecord component.- Returns:
- the value of the
failureReasonrecord component
-