com.atlassian.jira.webtest.framework.core.query
Class Queries

java.lang.Object
  extended by com.atlassian.jira.webtest.framework.core.query.Queries

public final class Queries
extends Object

Factory of useful TimedQuery implementations.

Since:
v4.3

Nested Class Summary
static class Queries.ConditionalQueryForQuery<V>
           
static class Queries.ConditionalQueryForValue<V>
           
static class Queries.ForQueryBuilder<V>
           
static class Queries.ForValueBuilder<V>
           
 
Method Summary
static
<T> Queries.ForQueryBuilder<T>
conditionalQuery(TimedQuery<T> query, TimedCondition condition)
           Create new TimedQuery instance that will evaluate to the value provided by query and only return, if the provided condition evaluates to true.
static
<T> Queries.ForValueBuilder<T>
conditionalQuery(T value, TimedCondition condition)
           Return a builder that will create new TimedQuery instance that will evaluate to the provided value and only return, if the provided condition evaluates to true.
static
<T,U> TimedQuery<U>
transform(TimedQuery<T> original, Function<T,U> transformer)
          Transform original query into a new timed query that has the same timing semantics (conditions of return, default timeout, wait interval etc.), but returns value of new type transformed from the original by the transformer function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

conditionalQuery

public static <T> Queries.ForValueBuilder<T> conditionalQuery(T value,
                                                              TimedCondition condition)

Return a builder that will create new TimedQuery instance that will evaluate to the provided value and only return, if the provided condition evaluates to true. The timeout characteristics of the returned query will be the same as in condition, and may be customized by modifying the builder.

A default ExpirationHandler instance provided to handle the case of expired query will be ExpirationHandler.RETURN_NULL. Custom handlers may be provided to the builder if necessary.

Type Parameters:
T - type of the query result
Parameters:
value - value of the target query
condition - underlying condition
Returns:
new conditional query

conditionalQuery

public static <T> Queries.ForQueryBuilder<T> conditionalQuery(TimedQuery<T> query,
                                                              TimedCondition condition)

Create new TimedQuery instance that will evaluate to the value provided by query and only return, if the provided condition evaluates to true. The timeout characteristics of the returned query will be the same as in query, and may be customized by modifying the builder.

A default ExpirationHandler instance provided to handle the case of expired query will be ExpirationHandler.RETURN_NULL. Custom handlers may be provided to the builder if necessary.

Type Parameters:
T - type of the query result
Parameters:
query - underlying query
condition - underlying condition
Returns:
new conditional query

transform

public static <T,U> TimedQuery<U> transform(TimedQuery<T> original,
                                            Function<T,U> transformer)
Transform original query into a new timed query that has the same timing semantics (conditions of return, default timeout, wait interval etc.), but returns value of new type transformed from the original by the transformer function.

Type Parameters:
T - original query result type
U - target query result type
Parameters:
original - original query
transformer - function transforming results of the query
Returns:
new transformed query


Copyright © 2002-2013 Atlassian. All Rights Reserved.