Record Class PlannerHandle.PlanStep

java.lang.Object
java.lang.Record
com.tnsai.planning.PlannerHandle.PlanStep
Record Components:
actionName - the action method name to invoke
precondition - condition that must be true before execution (may be empty)
postcondition - expected state changes after execution (may be empty)
fulfills - set of goal names this step contributes to
Enclosing interface:
PlannerHandle

public static record PlannerHandle.PlanStep(String actionName, String precondition, String postcondition, Set<String> fulfills) extends Record
A single step in an executable plan.
  • Constructor Details

    • PlanStep

      public PlanStep(String actionName, String precondition, String postcondition, Set<String> fulfills)
      Creates an instance of a PlanStep record class.
      Parameters:
      actionName - the value for the actionName record component
      precondition - the value for the precondition record component
      postcondition - the value for the postcondition record component
      fulfills - the value for the fulfills record component
  • Method Details

    • of

      public static PlannerHandle.PlanStep of(String actionName)
      Creates a simple plan step with just an action name.
    • of

      public static PlannerHandle.PlanStep of(String actionName, String precondition, String postcondition, String... fulfills)
      Creates a plan step with fulfills information.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • actionName

      public String actionName()
      Returns the value of the actionName record component.
      Returns:
      the value of the actionName record component
    • precondition

      public String precondition()
      Returns the value of the precondition record component.
      Returns:
      the value of the precondition record component
    • postcondition

      public String postcondition()
      Returns the value of the postcondition record component.
      Returns:
      the value of the postcondition record component
    • fulfills

      public Set<String> fulfills()
      Returns the value of the fulfills record component.
      Returns:
      the value of the fulfills record component