Package com.tnsai.planning
Record Class PlannerHandle.StepResult
java.lang.Object
java.lang.Record
com.tnsai.planning.PlannerHandle.StepResult
- Record Components:
actionName- the action that was executedexecuted- true if the action ran successfullyerror- error message if execution failed (null on success)
- Enclosing interface:
PlannerHandle
public static record PlannerHandle.StepResult(String actionName, boolean executed, String error)
extends Record
Result of executing a single plan step.
-
Constructor Summary
ConstructorsConstructorDescriptionStepResult(String actionName, boolean executed, String error) Creates an instance of aStepResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactionNamerecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.booleanexecuted()Returns the value of theexecutedrecord component.static PlannerHandle.StepResultCreates a failed step result.final inthashCode()Returns a hash code value for this object.static PlannerHandle.StepResultCreates a successful step result.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
StepResult
Creates an instance of aStepResultrecord class.- Parameters:
actionName- the value for theactionNamerecord componentexecuted- the value for theexecutedrecord componenterror- the value for theerrorrecord component
-
-
Method Details
-
success
Creates a successful step result. -
failure
Creates a failed step result. -
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 '=='. -
actionName
Returns the value of theactionNamerecord component.- Returns:
- the value of the
actionNamerecord component
-
executed
public boolean executed()Returns the value of theexecutedrecord component.- Returns:
- the value of the
executedrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-