Class GTaskResult

java.lang.Object
ghidra.framework.task.GTaskResult

public class GTaskResult extends Object
Class to represent the result state of a GTask, such as whether it was cancelled or an exception happened.
  • Constructor Details

    • GTaskResult

      public GTaskResult(GTaskGroup group, GScheduledTask task, Exception e, Integer transactionID)
      Constructs a GTaskResult for a completed GTask with an optional exception.
      Parameters:
      group - The GTaskGroup that the completed GTask belonged to.
      task - the GScheduledTask which contains the actual GTask that has completed.
      e - optional exception recorded if an exception occurred while processing the task. If the task was cancelled, there should be a CancelledException passed in here.
      transactionID - The transaction id for the transaction that was open when the task was executed. Used by the results GUI to indicate when transactions are opened and closed between tasks.
  • Method Details

    • getDescription

      public String getDescription()
      Returns a description of the task that was run.
      Returns:
      a description of the task that was run.
    • wasCancelled

      public boolean wasCancelled()
      Returns true if the task for this result was cancelled.
      Returns:
      true if the task for this result was cancelled.
    • getException

      public Exception getException()
      Returns the exception generated by the task, or null if no exception was generated. If the task was cancelled, this will return a CancelledException.
      Returns:
      the exception generated by this task or null.
    • getPriority

      public int getPriority()
      Returns the priority at which the task was run within its group.
      Returns:
      the priority at which the task was run within its group.
    • getGroupDescription

      public String getGroupDescription()
      Returns the description for the group for which this task belonged.
      Returns:
      the description for the group for which this task belonged.
    • hasSameTransaction

      public boolean hasSameTransaction(GTaskResult result)
      Returns true if the task represented by this result was executed in the same transaction as the task represented by the given GTaskResult.
      Parameters:
      result - the result to check if it was executed in the same transaction as this task result.
      Returns:
      true if same transaction.
    • toString

      public String toString()
      Overrides:
      toString in class Object