|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.pageobjects.elements.query.Conditions
public final class Conditions
Utilities to create miscellaneous TimedConditions.
| 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 TimedCondition |
alwaysFalse()
A timed condition that always returns false |
|
static TimedCondition |
alwaysTrue()
A timed condition that always returns true |
|
static Conditions.CombinableCondition |
and(Iterable<TimedQuery<Boolean>> conditions)
Return new combinable condition that is logical product of conditions. |
|
static Conditions.CombinableCondition |
and(TimedQuery<Boolean>... conditions)
Return new combinable condition that is logical product of conditions. |
|
static TimedCondition |
dependantCondition(TimedQuery<Boolean> original,
com.google.common.base.Supplier<TimedQuery<Boolean>> 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
|
forMatcher(TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher)
Return condition that will be true, if given matcher will match the query. |
|
static TimedCondition |
forSupplier(long defaultTimeout,
com.google.common.base.Supplier<Boolean> supplier)
Returns a timed condition, whose current evaluation is based on a value provided by given supplier. |
|
static TimedCondition |
forSupplier(com.google.common.base.Supplier<Boolean> supplier)
Returns a timed condition, whose current evaluation is based on a value provided by given supplier. |
|
static TimedCondition |
forSupplier(Timeouts timeouts,
com.google.common.base.Supplier<Boolean> supplier)
Returns a timed condition, whose current evaluation is based on a value provided by given supplier. |
|
static
|
isEqual(T value,
TimedQuery<T> query)
Returns timed condition verifying that given query will evaluate to value equal to value. |
|
static TimedQuery<Boolean> |
not(TimedQuery<Boolean> condition)
Return new timed condition that is a negation of condition. |
|
static Conditions.CombinableCondition |
or(Iterable<TimedQuery<Boolean>> conditions)
Return new combinable condition that is logical sum of conditions. |
|
static Conditions.CombinableCondition |
or(TimedQuery<Boolean>... 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 TimedQuery<Boolean> not(TimedQuery<Boolean> condition)
condition - condition to be negated
TimedCondition instance.public static Conditions.CombinableCondition and(TimedQuery<Boolean>... 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(Iterable<TimedQuery<Boolean>> 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(TimedQuery<Boolean>... 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(Iterable<TimedQuery<Boolean>> 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 dependantCondition(TimedQuery<Boolean> original,
com.google.common.base.Supplier<TimedQuery<Boolean>> 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 or the raised exception be propagated by
this condition respectively.
original - original conditiondependant - supplier for dependant condition that will only be evaluated given the original condition
evaluates to true
public static <T> TimedCondition forMatcher(TimedQuery<T> query,
org.hamcrest.Matcher<? super T> matcher)
Return condition that will be true, if given matcher will match the query. Any
Hamcrest matcher implementation may be used.
Example:
TimedCondition textEquals = Conditions.forMatcher(element.getText(), isEqualTo("blah"));
T - type of the resultquery - timed query to matchmatcher - matcher for the query
public static <T> TimedCondition isEqual(T value,
TimedQuery<T> query)
T - type of the valuevalue - value that query should be equalt toquery - the timed query
public static TimedCondition forSupplier(com.google.common.base.Supplier<Boolean> supplier)
supplier - supplier of the current condition value
public static TimedCondition forSupplier(long defaultTimeout,
com.google.common.base.Supplier<Boolean> supplier)
defaultTimeout - default timeout of the conditionsupplier - supplier of the current condition value
public static TimedCondition forSupplier(Timeouts timeouts,
com.google.common.base.Supplier<Boolean> supplier)
timeouts - an instance of timeouts to use for the new conditionsupplier - supplier of the current condition value
public static TimedCondition alwaysTrue()
true
public static TimedCondition alwaysFalse()
false
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||