Package: grails.async

## [Java] Class Promises

- grails.async.Promises

- Factory class for working with Promise instances

  Authors:
    Graeme Rocher
  Since:
    2.3

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `static Promise<T>` | `createBoundPromise(T value)` @see PromiseFactory#createBoundPromise(java.lang.Object)
    `static Promise<java.util.Map<K, V>>` | `createPromise(java.util.Map<K, V> map)` @see PromiseFactory#createPromise(java.util.Map)
    `static Promise<T>` | `createPromise(groovy.lang.Closure<T>... c)` @see PromiseFactory#createPromise(groovy.lang.Closure[])
    `static Promise<T>` | `createPromise(groovy.lang.Closure<T> c, java.util.List<PromiseDecorator> decorators)` @see PromiseFactory#createPromise(groovy.lang.Closure, java.util.List)
    `static Promise<java.util.List<T>>` | `createPromise(java.util.List<groovy.lang.Closure<T>> closures, java.util.List<PromiseDecorator> decorators)` @see PromiseFactory#createPromise(java.util.List, java.util.List)
    `static Promise<java.util.List<T>>` | `createPromise(Promise<T>... promises)` @see PromiseFactory#createPromise(grails.async.Promise[])
    `static PromiseFactory` | `getPromiseFactory()`
    `static Promise<java.util.List<T>>` | `onComplete(java.util.List<Promise<T>> promises, groovy.lang.Closure<?> callable)` @see PromiseFactory#onComplete(java.util.List, groovy.lang.Closure)
    `static Promise<java.util.List<T>>` | `onError(java.util.List<Promise<T>> promises, groovy.lang.Closure<?> callable)` @see PromiseFactory#onError(java.util.List, groovy.lang.Closure)
    `static void` | `setPromiseFactory(PromiseFactory promiseFactory)`
    `static Promise<T>` | `task(groovy.lang.Closure<T> c)` @see PromiseFactory#createPromise(groovy.lang.Closure[])
    `static Promise<java.util.Map<K, V>>` | `tasks(java.util.Map<K, V> map)` @see PromiseFactory#createPromise(java.util.Map)
    `static Promise<T>` | `tasks(groovy.lang.Closure<T>... c)` @see PromiseFactory#createPromise(groovy.lang.Closure[])
    `static Promise<java.util.List<T>>` | `tasks(java.util.List<groovy.lang.Closure<T>> closures)` @see PromiseFactory#createPromise(groovy.lang.Closure[])
    `static java.util.List<T>` | `waitAll(Promise<T>... promises)` @see PromiseFactory#waitAll(grails.async.Promise[])
    `static java.util.List<T>` | `waitAll(java.util.List<Promise<T>> promises)` @see PromiseFactory#waitAll(java.util.List)
    `static java.util.List<T>` | `waitAll(java.util.List<Promise<T>> promises, long timeout, java.util.concurrent.TimeUnit units)` @see PromiseFactory#waitAll(java.util.List)

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Method Detail

    - #### public static Promise<T> createBoundPromise(T value)

      See Also:
        PromiseFactory.createBoundPromise

    - #### public static Promise<java.util.Map<K, V>> createPromise(java.util.Map<K, V> map)

      See Also:
        PromiseFactory.createPromise

    - #### public static Promise<T> createPromise(groovy.lang.Closure<T>... c)

      See Also:
        PromiseFactory.createPromise

    - #### public static Promise<T> createPromise(groovy.lang.Closure<T> c, java.util.List<PromiseDecorator> decorators)

      See Also:
        PromiseFactory.createPromise

    - #### public static Promise<java.util.List<T>> createPromise(java.util.List<groovy.lang.Closure<T>> closures, java.util.List<PromiseDecorator> decorators)

      See Also:
        PromiseFactory.createPromise

    - #### public static Promise<java.util.List<T>> createPromise(Promise<T>... promises)

      See Also:
        PromiseFactory.createPromise

    - #### public static PromiseFactory getPromiseFactory()

    - #### public static Promise<java.util.List<T>> onComplete(java.util.List<Promise<T>> promises, groovy.lang.Closure<?> callable)

      See Also:
        PromiseFactory.onComplete

    - #### public static Promise<java.util.List<T>> onError(java.util.List<Promise<T>> promises, groovy.lang.Closure<?> callable)

      See Also:
        PromiseFactory.onError

    - #### public static void setPromiseFactory(PromiseFactory promiseFactory)

    - #### public static Promise<T> task(groovy.lang.Closure<T> c)

      See Also:
        PromiseFactory.createPromise

    - #### public static Promise<java.util.Map<K, V>> tasks(java.util.Map<K, V> map)

      See Also:
        PromiseFactory.createPromise

    - #### public static Promise<T> tasks(groovy.lang.Closure<T>... c)

      See Also:
        PromiseFactory.createPromise

    - #### public static Promise<java.util.List<T>> tasks(java.util.List<groovy.lang.Closure<T>> closures)

      See Also:
        PromiseFactory.createPromise

    - #### public static java.util.List<T> waitAll(Promise<T>... promises)

      See Also:
        PromiseFactory.waitAll

    - #### public static java.util.List<T> waitAll(java.util.List<Promise<T>> promises)

      See Also:
        PromiseFactory.waitAll

    - #### public static java.util.List<T> waitAll(java.util.List<Promise<T>> promises, long timeout, java.util.concurrent.TimeUnit units)

      See Also:
        PromiseFactory.waitAll