Module org.autogui

Class GuiSwingTaskRunner.ContextTaskResult<RetType>

java.lang.Object
org.autogui.swing.GuiSwingTaskRunner.ContextTaskResult<RetType>
Type Parameters:
RetType - the type of the value
Direct Known Subclasses:
GuiSwingTaskRunner.ContextTaskResultFail, GuiSwingTaskRunner.ContextTaskResultFailException, GuiSwingTaskRunner.ContextTaskResultWithDelay
Enclosing class:
GuiSwingTaskRunner

public static class GuiSwingTaskRunner.ContextTaskResult<RetType> extends Object
the returned value for successfully obtaining a value
  • Field Details

  • Constructor Details

    • ContextTaskResult

      public ContextTaskResult(RetType value)
  • Method Details

    • getValue

      public RetType getValue()
    • isCancel

      public boolean isCancel()
    • isTimeout

      public boolean isTimeout()
    • isPresentedWithDelay

      public boolean isPresentedWithDelay()
    • isError

      public boolean isError()
      Returns:
      true if the value is an error
      Since:
      1.6.1
    • isPresented

      public boolean isPresented()
      Returns:
      true if no-cancellation, no-timeout, immediately returned
    • executeIfPresent

      public void executeIfPresent(Consumer<RetType> task)
      executes the task with it's obtained value (both immediate and delayed cases)
      Parameters:
      task - to be executed with the value
    • executeIfPresentWithDelay

      public void executeIfPresentWithDelay(Consumer<RetType> task)
      executes the task if delayed (nothing happen with the class)
      Parameters:
      task - to be executed with the value
    • getValueOr

      public RetType getValueOr(RetType cancelValue, RetType timeoutValue)
    • toString

      public String toString()
      Overrides:
      toString in class Object