View Javadoc

1   package com.atlassian.pageobjects.internal.elements.search;
2   
3   import com.atlassian.pageobjects.elements.PageElement;
4   import com.atlassian.pageobjects.elements.WebDriverElement;
5   import com.atlassian.pageobjects.elements.search.DefaultQuery;
6   import com.google.common.base.Supplier;
7   import com.google.common.base.Suppliers;
8   import com.google.common.collect.ImmutableList;
9   
10  import javax.annotation.Nonnull;
11  
12  import static com.google.common.base.Preconditions.checkNotNull;
13  
14  public class DefaultWebDriverQuery extends WebDriverElementQuery<PageElement> implements DefaultQuery
15  {
16      public DefaultWebDriverQuery(@Nonnull WebDriverElement root)
17      {
18          super(defaultSupplier(checkNotNull(root, "root")), PageElement.class, root.getDefaultTimeout());
19      }
20  
21      private static Supplier<Iterable<PageElement>> defaultSupplier(PageElement pageElement)
22      {
23          return Suppliers.<Iterable<PageElement>>ofInstance(ImmutableList.of(pageElement));
24      }
25  }