Class EvaluatedCondition<T>

java.lang.Object
org.awaitility.core.EvaluatedCondition<T>
Type Parameters:
T - The condition evaluation result value type.

public class EvaluatedCondition<T> extends Object
Contains properties of the condition at its current stage.
  • Field Details

    • description

      private final String description
    • matcher

      private final org.hamcrest.Matcher<? super T> matcher
    • currentConditionValue

      private final T currentConditionValue
    • elapsedTimeInMS

      private final long elapsedTimeInMS
    • pollInterval

      private final Duration pollInterval
    • remainingTimeInMS

      private final long remainingTimeInMS
    • conditionIsFulfilled

      private final boolean conditionIsFulfilled
    • alias

      private final String alias
  • Constructor Details

    • EvaluatedCondition

      EvaluatedCondition(String description, org.hamcrest.Matcher<? super T> matcher, T currentConditionValue, long elapsedTimeInMS, long remainingTimeInMS, boolean isConditionSatisfied, String alias, Duration pollInterval)
      Parameters:
      description - A descriptive match message or mismatch message of the matcher. If isConditionSatisfied is true then it describes a match message, if false then it describes a mismatch message.
      matcher - The Hamcrest matcher used in the condition
      currentConditionValue - The current value of the condition.
      elapsedTimeInMS - elapsed time in milliseconds.
      remainingTimeInMS - remaining time to wait in milliseconds; Long.MAX_VALUE, if no timeout defined, i.e., running forever.
      isConditionSatisfied - true if the condition is satisfied (i.e. hamcrest matcher matches the value), false otherwise (i.e. an intermediate value).
  • Method Details

    • getDescription

      public String getDescription()
      Returns:
      Descriptive message of the Hamcrest matcher.
    • isHamcrestCondition

      public boolean isHamcrestCondition()
      Returns:
      true if the condition has a matcher (i.e. it's a Hamcrest Based condition) which means that getMatcher() will return a non-null value.
    • getMatcher

      public org.hamcrest.Matcher<? super T> getMatcher()
      Returns:
      The Hamcrest matcher used in the condition if this condition is a Hamcrest condition
      See Also:
    • getValue

      public T getValue()
      Returns:
      The current value of the condition.
    • getElapsedTimeInMS

      public long getElapsedTimeInMS()
      Returns:
      Elapsed time in milliseconds.
    • getRemainingTimeInMS

      public long getRemainingTimeInMS()
      Returns:
      Remaining time to wait in milliseconds or Long.MAX_VALUE if no timeout defined, i.e., running forever.
    • isConditionRunningForever

      public boolean isConditionRunningForever()
      Returns:
      true if the condition doesn't have a timeout, false otherwise.
    • isSatisfied

      public boolean isSatisfied()
      Returns:
      true if the condition is satisfied (i.e. hamcrest matcher matches the value), false otherwise (i.e. an intermediate value).
    • getAlias

      public String getAlias()
      Returns:
      The Awaitility alias for the condition (if any).
      See Also:
    • hasAlias

      public boolean hasAlias()
      Returns:
      true if this condition defined an alias.
      See Also:
    • getPollInterval

      public Duration getPollInterval()
      Returns:
      The poll interval for the evaluation round