Package com.tnsai.planning.llm
Record Class PlanApprovalGate.ApprovalDecision
java.lang.Object
java.lang.Record
com.tnsai.planning.llm.PlanApprovalGate.ApprovalDecision
- Record Components:
type- approval typereason- reason for rejection (null if approved)removedSteps- indices of steps to remove (for MODIFIED)newOrder- new step order indices (for MODIFIED)
- Enclosing class:
PlanApprovalGate
public static record PlanApprovalGate.ApprovalDecision(PlanApprovalGate.ApprovalType type, String reason, List<Integer> removedSteps, List<Integer> newOrder)
extends Record
Represents the user's decision after reviewing a plan.
-
Constructor Summary
ConstructorsConstructorDescriptionApprovalDecision(PlanApprovalGate.ApprovalType type, String reason, List<Integer> removedSteps, List<Integer> newOrder) Creates an instance of aApprovalDecisionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapprove()Approve the plan as-is.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Approve with both removals and reordering.newOrder()Returns the value of thenewOrderrecord component.reason()Returns the value of thereasonrecord component.Reject the plan with a reason.Returns the value of theremovedStepsrecord component.removeSteps(List<Integer> stepsToRemove) Approve with step removals.Approve with reordering.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
ApprovalDecision
public ApprovalDecision(PlanApprovalGate.ApprovalType type, String reason, List<Integer> removedSteps, List<Integer> newOrder) Creates an instance of aApprovalDecisionrecord class.- Parameters:
type- the value for thetyperecord componentreason- the value for thereasonrecord componentremovedSteps- the value for theremovedStepsrecord componentnewOrder- the value for thenewOrderrecord component
-
-
Method Details
-
approve
Approve the plan as-is. -
reject
Reject the plan with a reason. -
removeSteps
Approve with step removals. -
reorder
Approve with reordering. -
modify
public static PlanApprovalGate.ApprovalDecision modify(List<Integer> removedSteps, List<Integer> newOrder) Approve with both removals and reordering. -
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
reason
Returns the value of thereasonrecord component.- Returns:
- the value of the
reasonrecord component
-
removedSteps
Returns the value of theremovedStepsrecord component.- Returns:
- the value of the
removedStepsrecord component
-
newOrder
Returns the value of thenewOrderrecord component.- Returns:
- the value of the
newOrderrecord component
-