Class Condition

java.lang.Object
org.fest.swing.timing.Condition
Direct Known Subclasses:
ComponentEnabledCondition, ComponentFoundCondition, EdtSafeCondition, JTreeChildrenShowUpCondition, WaitForComponentToShowCondition

public abstract class Condition extends Object
Understands a condition to verify, usually used in the method Pause.pause(Condition).
  • Field Details

    • EMPTY_TEXT

      protected static final String EMPTY_TEXT
      See Also:
    • description

      private final org.fest.assertions.Description description
  • Constructor Details

    • Condition

      public Condition(String description)
      Creates a new Condition.
      Parameters:
      description - describes this condition.
    • Condition

      public Condition(org.fest.assertions.Description description)
      Creates a new Condition.
      Parameters:
      description - describes this condition.
  • Method Details

    • test

      public abstract boolean test()
      Checks if the condition has been satisfied.
      Returns:
      true if the condition has been satisfied, otherwise false.
    • toString

      public final String toString()
      Returns the String representation of this condition, which is its description.
      Overrides:
      toString in class Object
      Returns:
      the description of this condition.
    • defaultDescription

      private String defaultDescription()
    • descriptionAddendum

      protected String descriptionAddendum()
      Returns any text to be added to this condition's description. The default value is an empty String.
      Returns:
      by default, an empty String.
    • done

      protected void done()
      Notification that this condition has been evaluated. This method is invoked by Pause.pause(Condition) (and all overloaded methods) when this condition is evaluated (either it was satisfied or it timed-out.) This is a good place to do any necessary resource cleanup.