|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.pageobjects.elements.query.AbstractPollingQuery
com.atlassian.pageobjects.elements.query.AbstractTimedQuery<T>
@NotThreadSafe public abstract class AbstractTimedQuery<T>
Abstract query that implements byDefaultTimeout() in terms of by(long), and by(long) as a
template method calling the following hooks (to be implemented by subclasses):
currentValue() - to determine current evaluation of the query
shouldReturn(Object) - which indicates, if current value of the query should be returned
In addition, an ExpirationHandler must be provided to handle the case of expired query.
ExpirationHandler| Field Summary |
|---|
| Fields inherited from class com.atlassian.pageobjects.elements.query.AbstractPollingQuery |
|---|
defaultTimeout, interval |
| Fields inherited from interface com.atlassian.pageobjects.elements.query.PollingQuery |
|---|
DEFAULT_INTERVAL |
| Constructor Summary | |
|---|---|
protected |
AbstractTimedQuery(Clock clock,
long defTimeout,
long interval,
ExpirationHandler expirationHandler)
|
protected |
AbstractTimedQuery(long defTimeout,
long interval,
ExpirationHandler expirationHandler)
|
protected |
AbstractTimedQuery(PollingQuery other,
ExpirationHandler expirationHandler)
|
| Method Summary | |
|---|---|
T |
by(long timeout)
Evaluate this query by given timeout. |
T |
by(long timeout,
TimeUnit unit)
Evaluate this query by given timeout. |
T |
byDefaultTimeout()
Evaluate this query by a timeout deemed default by this query. |
Clock |
clock()
Clock used by this instance. |
protected abstract T |
currentValue()
Current evaluation of the query. |
ExpirationHandler |
expirationHandler()
Expiration handler of this query |
T |
now()
Evaluate this query immediately. |
protected void |
resetLastRun()
|
protected abstract boolean |
shouldReturn(T currentEval)
If the current evaluated query value should be returned. |
String |
toString()
|
| Methods inherited from class com.atlassian.pageobjects.elements.query.AbstractPollingQuery |
|---|
defaultTimeout, interval |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.atlassian.pageobjects.elements.query.PollingQuery |
|---|
defaultTimeout, interval |
| Constructor Detail |
|---|
protected AbstractTimedQuery(Clock clock,
long defTimeout,
long interval,
ExpirationHandler expirationHandler)
protected AbstractTimedQuery(long defTimeout,
long interval,
ExpirationHandler expirationHandler)
protected AbstractTimedQuery(PollingQuery other,
ExpirationHandler expirationHandler)
| Method Detail |
|---|
public final T by(long timeout)
TimedQuerynull, or throw exception
by in interface TimedQuery<T>timeout - timeout in milliseconds (must be greater than 0)
public final T by(long timeout,
TimeUnit unit)
TimedQuerynull, or throw exception
by in interface TimedQuery<T>timeout - timeout (must be greater than 0)unit - the unit that the timeout is in
public T byDefaultTimeout()
TimedQuery
byDefaultTimeout in interface TimedQuery<T>PollingQuery.defaultTimeout()public final T now()
TimedQuery
now in interface TimedQuery<T>public final ExpirationHandler expirationHandler()
protected abstract boolean shouldReturn(T currentEval)
currentEval - current query evaluation
expires
true, if the current query evaluation should be returned as a result of this timed queryprotected abstract T currentValue()
public Clock clock()
ClockAware
clock in interface ClockAwareprotected void resetLastRun()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||