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       * @return The binder for chaining
11       */
12      DelayedBinder<T> inject();
13  
14      /**
15       * Builds the page object and executes its waitfor lifecycle methods
16       *
17       * @return The binder for chaining
18       */
19      DelayedBinder<T> waitUntil();
20  
21      /**
22       * Builds, waits for, and validates the state of the page object
23       * @return The binder for chaining
24       */
25      DelayedBinder<T> validateState();
26  
27      /**
28       * Goes through the full binding, including lifecycle methods, to determine whether the page object can be bound.
29       * @return True if the binding was successful
30       */
31      boolean canBind();
32  
33      /**
34       * @return The current page object, building if necessary.  If called before any other methods are called, it will
35       * return the instantiated object but with no injections or lifecycle methods called.
36       */
37      T get();
38  
39      /**
40       * Builds, waits for, validates the state of, and returns the page object
41       * @return The fully bound page object
42       */
43      T bind();
44  }