public abstract class AbstractSearchQuery<E,Q extends SearchQuery<E,Q>> extends Object implements SearchQuery<E,Q>
| Modifier and Type | Field and Description |
|---|---|
protected PageBinder |
pageBinder |
protected com.google.common.base.Supplier<Iterable<E>> |
querySupplier |
protected Timeouts |
timeouts |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractSearchQuery(com.google.common.base.Supplier<Iterable<E>> querySupplier) |
| Modifier and Type | Method and Description |
|---|---|
<F> AnyQuery<F> |
bindTo(Class<F> pageObjectClass,
Object... extraArgs)
Map the results by binding into a page object.
|
Q |
filter(com.google.common.base.Predicate<? super E> predicate)
Filter the underlying results using
predicate. |
E |
first() |
<F> AnyQuery<F> |
flatMap(com.google.common.base.Function<? super E,Iterable<F>> mapper)
Flat map the results using
mapper. |
protected <F> com.google.common.base.Supplier<Iterable<F>> |
flatMapSupplier(com.google.common.base.Function<? super E,Iterable<F>> mapper) |
Iterable<E> |
get() |
TimedCondition |
hasResult() |
<F> AnyQuery<F> |
map(com.google.common.base.Function<? super E,F> mapper)
Map the query results using
mapper. |
protected <F> com.google.common.base.Supplier<Iterable<F>> |
mapSupplier(com.google.common.base.Function<? super E,F> mapper) |
protected abstract <F> AnyQuery<F> |
newAnyQueryInstance(com.google.common.base.Supplier<Iterable<F>> supplier) |
protected abstract Q |
newInstance(com.google.common.base.Supplier<Iterable<E>> supplier) |
Iterable<E> |
now()
Equivalent to
Supplier.get(). |
TimedQuery<Iterable<E>> |
timed() |
@Inject protected Timeouts timeouts
@Inject protected PageBinder pageBinder
@Nonnull public final Q filter(@Nonnull com.google.common.base.Predicate<? super E> predicate)
SearchQuerypredicate.filter in interface SearchQuery<E,Q extends SearchQuery<E,Q>>predicate - predicate to filter the results@Nonnull public final <F> AnyQuery<F> map(@Nonnull com.google.common.base.Function<? super E,F> mapper)
SearchQuerymapper.map in interface SearchQuery<E,Q extends SearchQuery<E,Q>>F - the new result typemapper - a function to map the results@Nonnull public final <F> AnyQuery<F> flatMap(@Nonnull com.google.common.base.Function<? super E,Iterable<F>> mapper)
SearchQuerymapper.flatMap in interface SearchQuery<E,Q extends SearchQuery<E,Q>>F - the new result typemapper - the function to use to flat map@Nonnull public final <F> AnyQuery<F> bindTo(@Nonnull Class<F> pageObjectClass, @Nonnull Object... extraArgs)
SearchQuerybindTo in interface SearchQuery<E,Q extends SearchQuery<E,Q>>F - the new result typepageObjectClass - page object classextraArgs - extra arguments to the bind methodPageObjects.bind(PageBinder, Iterable, Class, Object...)@Nullable public final E first()
first in interface SearchQuery<E,Q extends SearchQuery<E,Q>>null if there is no results@Nonnull public final Iterable<E> now()
SearchQuerySupplier.get().now in interface SearchQuery<E,Q extends SearchQuery<E,Q>>@Nonnull public final TimedCondition hasResult()
hasResult in interface SearchQuery<E,Q extends SearchQuery<E,Q>>@Nonnull public final TimedQuery<Iterable<E>> timed()
timed in interface SearchQuery<E,Q extends SearchQuery<E,Q>>@Nonnull protected abstract Q newInstance(@Nonnull com.google.common.base.Supplier<Iterable<E>> supplier)
@Nonnull protected abstract <F> AnyQuery<F> newAnyQueryInstance(@Nonnull com.google.common.base.Supplier<Iterable<F>> supplier)
protected final <F> com.google.common.base.Supplier<Iterable<F>> flatMapSupplier(@Nonnull com.google.common.base.Function<? super E,Iterable<F>> mapper)
Copyright © 2015 Atlassian. All rights reserved.