Package org.awaitility.core
Class ConditionEvaluationHandler<T>
- java.lang.Object
-
- org.awaitility.core.ConditionEvaluationHandler<T>
-
class ConditionEvaluationHandler<T> extends java.lang.ObjectHandler forConditionimplementations that callsConditionEvaluationListenerwith condition evaluation result and message. It also serves as stop watch for elapsed time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classConditionEvaluationHandler.StopWatch
-
Field Summary
Fields Modifier and Type Field Description private org.hamcrest.Matcher<? super T>matcherprivate ConditionSettingssettingsprivate ConditionEvaluationHandler.StopWatchwatch
-
Constructor Summary
Constructors Constructor Description ConditionEvaluationHandler(org.hamcrest.Matcher<? super T> matcher, ConditionSettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddoWithListener(java.util.function.Consumer<ConditionEvaluationListener<T>> consumer)private longgetRemainingTimeInMS(long elapsedTimeInMS, java.time.Duration maxWaitTime)(package private) voidhandleConditionResultMatch(java.lang.String matchMessage, T currentConditionValue, java.time.Duration pollInterval)(package private) voidhandleConditionResultMismatch(java.lang.String mismatchMessage, T currentConditionValue, java.time.Duration pollInterval)voidhandleIgnoredException(java.lang.Throwable throwable)voidhandleTimeout(java.lang.String message, boolean isConditionSatisfied)voidstart()private voidthrowClassCastExceptionBecauseConditionEvaluationListenerCouldNotBeApplied(java.lang.ClassCastException e, ConditionEvaluationListener listener)
-
-
-
Field Detail
-
matcher
private final org.hamcrest.Matcher<? super T> matcher
-
settings
private final ConditionSettings settings
-
watch
private final ConditionEvaluationHandler.StopWatch watch
-
-
Constructor Detail
-
ConditionEvaluationHandler
ConditionEvaluationHandler(org.hamcrest.Matcher<? super T> matcher, ConditionSettings settings)
-
-
Method Detail
-
handleConditionResultMismatch
void handleConditionResultMismatch(java.lang.String mismatchMessage, T currentConditionValue, java.time.Duration pollInterval)
-
handleConditionResultMatch
void handleConditionResultMatch(java.lang.String matchMessage, T currentConditionValue, java.time.Duration pollInterval)
-
doWithListener
private void doWithListener(java.util.function.Consumer<ConditionEvaluationListener<T>> consumer)
-
getRemainingTimeInMS
private long getRemainingTimeInMS(long elapsedTimeInMS, java.time.Duration maxWaitTime)
-
throwClassCastExceptionBecauseConditionEvaluationListenerCouldNotBeApplied
private void throwClassCastExceptionBecauseConditionEvaluationListenerCouldNotBeApplied(java.lang.ClassCastException e, ConditionEvaluationListener listener)
-
start
public void start()
-
handleTimeout
public void handleTimeout(java.lang.String message, boolean isConditionSatisfied)
-
handleIgnoredException
public void handleIgnoredException(java.lang.Throwable throwable)
-
-