Package org.awaitility.core
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 java.lang.ObjectContains properties of the condition at its current stage.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringaliasprivate booleanconditionIsFulfilledprivate TcurrentConditionValueprivate java.lang.Stringdescriptionprivate longelapsedTimeInMSprivate org.hamcrest.Matcher<? super T>matcherprivate java.time.DurationpollIntervalprivate longremainingTimeInMS
-
Constructor Summary
Constructors Constructor Description EvaluatedCondition(java.lang.String description, org.hamcrest.Matcher<? super T> matcher, T currentConditionValue, long elapsedTimeInMS, long remainingTimeInMS, boolean isConditionSatisfied, java.lang.String alias, java.time.Duration pollInterval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAlias()java.lang.StringgetDescription()longgetElapsedTimeInMS()org.hamcrest.Matcher<? super T>getMatcher()java.time.DurationgetPollInterval()longgetRemainingTimeInMS()TgetValue()booleanhasAlias()booleanisConditionRunningForever()booleanisHamcrestCondition()booleanisSatisfied()
-
-
-
Field Detail
-
description
private final java.lang.String description
-
matcher
private final org.hamcrest.Matcher<? super T> matcher
-
currentConditionValue
private final T currentConditionValue
-
elapsedTimeInMS
private final long elapsedTimeInMS
-
pollInterval
private final java.time.Duration pollInterval
-
remainingTimeInMS
private final long remainingTimeInMS
-
conditionIsFulfilled
private final boolean conditionIsFulfilled
-
alias
private final java.lang.String alias
-
-
Constructor Detail
-
EvaluatedCondition
EvaluatedCondition(java.lang.String description, org.hamcrest.Matcher<? super T> matcher, T currentConditionValue, long elapsedTimeInMS, long remainingTimeInMS, boolean isConditionSatisfied, java.lang.String alias, java.time.Duration pollInterval)- Parameters:
description- A descriptive match message or mismatch message of the matcher. IfisConditionSatisfiedistruethen it describes a match message, iffalsethen it describes a mismatch message.matcher- The Hamcrest matcher used in the conditioncurrentConditionValue- 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-trueif the condition is satisfied (i.e. hamcrest matcher matches the value),falseotherwise (i.e. an intermediate value).
-
-
Method Detail
-
getDescription
public java.lang.String getDescription()
- Returns:
- Descriptive message of the Hamcrest matcher.
-
isHamcrestCondition
public boolean isHamcrestCondition()
- Returns:
trueif the condition has a matcher (i.e. it's a Hamcrest Based condition) which means thatgetMatcher()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:
isHamcrestCondition()
-
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_VALUEif no timeout defined, i.e., running forever.
-
isConditionRunningForever
public boolean isConditionRunningForever()
- Returns:
trueif the condition doesn't have a timeout,falseotherwise.
-
isSatisfied
public boolean isSatisfied()
- Returns:
trueif the condition is satisfied (i.e. hamcrest matcher matches the value),falseotherwise (i.e. an intermediate value).
-
getAlias
public java.lang.String getAlias()
- Returns:
- The Awaitility alias for the condition (if any).
- See Also:
hasAlias()
-
hasAlias
public boolean hasAlias()
- Returns:
trueif this condition defined an alias.- See Also:
getAlias()
-
getPollInterval
public java.time.Duration getPollInterval()
- Returns:
- The poll interval for the evaluation round
-
-