Record Class ExecutedAction

java.lang.Object
java.lang.Record
ca.mcscert.jpipe.commands.ExecutedAction

public record ExecutedAction(Command command, int depth) extends Record
A record of a single action that took place during execution: either a RegularCommand that was executed, or a MacroCommand that was expanded. The depth field reflects nesting level — top-level commands have depth 0; commands produced by expanding a macro inherit the macro's depth + 1.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExecutedAction(Command command, int depth)
    Creates an instance of a ExecutedAction record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the command record component.
    int
    Returns the value of the depth record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    True when this entry represents a macro expansion rather than direct execution.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ExecutedAction

      public ExecutedAction(Command command, int depth)
      Creates an instance of a ExecutedAction record class.
      Parameters:
      command - the value for the command record component
      depth - the value for the depth record component
  • Method Details

    • isMacro

      public boolean isMacro()
      True when this entry represents a macro expansion rather than direct execution.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • command

      public Command command()
      Returns the value of the command record component.
      Returns:
      the value of the command record component
    • depth

      public int depth()
      Returns the value of the depth record component.
      Returns:
      the value of the depth record component