|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.webtest.framework.core.condition.Conditions
public final class Conditions
Utilities to create miscellaneous TimedCondition
s.
Nested Class Summary | |
---|---|
static interface |
Conditions.CombinableCondition
A timed condition that may be logically combined with others, by means of basic logical operations: 'and'/'or'. |
Method Summary | |
---|---|
static Conditions.CombinableCondition |
and(List<TimedCondition> conditions)
Return new combinable condition that is logical product of conditions. |
static Conditions.CombinableCondition |
and(TimedCondition... conditions)
Return new combinable condition that is logical product of conditions. |
static TimedCondition |
dependantCondition(TimedCondition original,
Supplier<TimedCondition> dependant)
Returns a condition that combines original and dependant in a manner that dependant condition will only ever be retrieved if the original condition is true . |
static TimedCondition |
falseCondition()
Condition that always returns false |
static TimedCondition |
falseCondition(long defaultTimeout)
Condition that always returns false |
static TimedCondition |
not(TimedCondition condition)
Return new timed condition that is a negation of condition. |
static Conditions.CombinableCondition |
or(List<TimedCondition> conditions)
Return new combinable condition that is logical sum of conditions. |
static Conditions.CombinableCondition |
or(TimedCondition... conditions)
Return new combinable condition that is logical sum of conditions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static TimedCondition not(TimedCondition condition)
condition
- condition to be negated
TimedCondition
instance.public static Conditions.CombinableCondition and(TimedCondition... conditions)
Return new combinable condition that is logical product of conditions.
The resulting condition will have interval of the first condition in the conditions array,
conditions
- conditions to conjoin
IllegalArgumentException
- if conditions array is null
or emptyPollingQuery.interval()
public static Conditions.CombinableCondition and(List<TimedCondition> conditions)
Return new combinable condition that is logical product of conditions.
The resulting condition will have interval of the first condition in the conditions array,
conditions
- conditions to conjoin
IllegalArgumentException
- if conditions array is null
or emptyPollingQuery.interval()
public static Conditions.CombinableCondition or(TimedCondition... conditions)
Return new combinable condition that is logical sum of conditions.
The resulting condition will have interval of the first condition in the conditions array,
conditions
- conditions to sum
IllegalArgumentException
- if conditions array is null
or emptyPollingQuery.interval()
public static Conditions.CombinableCondition or(List<TimedCondition> conditions)
Return new combinable condition that is logical sum of conditions.
The resulting condition will have interval of the first condition in the conditions array,
conditions
- conditions to sum
IllegalArgumentException
- if conditions array is null
or emptyPollingQuery.interval()
public static TimedCondition falseCondition(long defaultTimeout)
false. Its interval will be equal to the default timeout.
- Parameters:
defaultTimeout
- default timeout
- Returns:
- false condition
public static TimedCondition falseCondition()
false, with default timeout of 100ms.
- Returns:
- false condition
public static TimedCondition dependantCondition(TimedCondition original, Supplier<TimedCondition> dependant)
Returns a condition that combines original and dependant in a manner that dependant condition
will only ever be retrieved if the original condition is true
. This is useful
when dependant condition may only be retrieved given the original condition is true
.
The supplier for dependant condition is allowed to return null
or throw exception if the
original condition returns false. But it may not do so given the original condition is true
,
as this will lead to NullPointerException
be raised or given exception be propagated by
this condition.
original
- original conditiondependant
- supplier for dependant condition that will only be evaluated given the original condition
evaluates to true
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |