1 package com.atlassian.pageobjects;
2
3 /**
4 * A delayed binder that gives the caller full control over the creation and lifecycle of the page object.
5 */
6 public interface DelayedBinder<T>
7 {
8 /**
9 * Instantiates, injects, and initialises the page object, but doesn't execute its lifecycle methods.
10 *
11 * @return The binder for chaining
12 */
13 DelayedBinder<T> inject();
14
15 /**
16 * Builds the page object and executes its waitfor lifecycle methods
17 *
18 * @return The binder for chaining
19 */
20 DelayedBinder<T> waitUntil();
21
22 /**
23 * Builds, waits for, and validates the state of the page object
24 * @return The binder for chaining
25 */
26 DelayedBinder<T> validateState();
27
28 /**
29 * Goes through the full binding, including lifecycle methods, to determine whether the page object can be bound.
30 * @return True if the binding was successful
31 */
32 boolean canBind();
33
34 /**
35 * @return The current page object, building if necessary. If called before any other methods are called, it will
36 * return the instantiated object but with no injections or lifecycle methods called.
37 */
38 T get();
39
40 /**
41 * Builds, waits for, validates the state of, and returns the page object
42 * @return The fully bound page object
43 */
44 T bind();
45 }