10
10
*******************************************************************************/
11
11
package org .eclipse .che .api .promises .client .js ;
12
12
13
- import org .eclipse .che .api .promises .client .Promise ;
14
- import org .eclipse .che .api .promises .client .PromiseError ;
15
- import com .google .gwt .core .client .JavaScriptObject ;
16
- import com .google .gwt .core .client .JsArrayMixed ;
17
-
18
13
import elemental .js .util .JsArrayOf ;
19
14
import elemental .util .ArrayOf ;
20
15
16
+ import com .google .gwt .core .client .JavaScriptObject ;
17
+ import com .google .gwt .core .client .JsArrayMixed ;
18
+
19
+ import org .eclipse .che .api .promises .client .Promise ;
20
+ import org .eclipse .che .api .promises .client .PromiseError ;
21
21
22
22
public final class Promises {
23
23
24
24
/** Private constructor, the class is not instantiable. */
25
- private Promises () {}
25
+ private Promises () {
26
+ }
26
27
27
28
/**
28
29
* Creates a new promise using the provided executor.
29
- * @param conclusion the executor
30
+ *
31
+ * @param conclusion
32
+ * the executor
33
+ * @param <V>
34
+ * the type of the promised value
30
35
* @return a promise
31
- * @param <V> the type of the promised value
32
36
*/
33
37
public static final native <V > JsPromise <V > create (Executor <V > conclusion ) /*-{
34
38
return new Promise(conclusion);
@@ -37,7 +41,9 @@ public static final native <V> JsPromise<V> create(Executor<V> conclusion) /*-{
37
41
/**
38
42
* Creates a promise that resolves as soon as all the promises used as parameters are resolved or rejected
39
43
* as soon as the first rejection happens on one of the included promises.
40
- * @param promises the included promises
44
+ *
45
+ * @param promises
46
+ * the included promises
41
47
* @return a promise with an array of unit values as fulfillment value
42
48
*/
43
49
public static final native JsPromise <JsArrayMixed > all (ArrayOf <Promise <?>> promises ) /*-{
@@ -46,7 +52,7 @@ public static final native JsPromise<JsArrayMixed> all(ArrayOf<Promise<?>> promi
46
52
47
53
public static final JsPromise <JsArrayMixed > all (final Promise <?>... promises ) {
48
54
final JsArrayOf <Promise <?>> promisesArray = JavaScriptObject .createArray ().cast ();
49
- for (final Promise <?> promise : promises ) {
55
+ for (final Promise <?> promise : promises ) {
50
56
promisesArray .push (promise );
51
57
}
52
58
return all (promisesArray );
0 commit comments