Skip to content

Commit

Permalink
Formating.
Browse files Browse the repository at this point in the history
  • Loading branch information
MammatusPlatypus committed Apr 10, 2016
1 parent c6d9eb4 commit d874dfe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/main/java/io/advantageous/reakt/Callback.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ default void reply(final T result) {

/**
* Resolve resolves a promise.
*
* @param result makes it more compatible with ES6 style promises
*/
default void resolve(final T result) {
Expand Down
22 changes: 10 additions & 12 deletions src/main/java/io/advantageous/reakt/promise/Promise.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ default Promise<T> freeze() {

/**
* If a result is sent, and there was no error, then handle the result.
*
*
* <p>
* <p>
* There is only one thenHandler.
*
* <p>
* Unlike ES6, {@code then(..)} cannot be chained per se, but {@code whenComplete(..)}, and
* {@code }thenMap(...)} can be nested.
*
*
* @param consumer executed if result has no error.
* @return this, fluent API
* @throws NullPointerException if result is present and {@code consumer} is
Expand All @@ -50,12 +49,12 @@ default Promise<T> freeze() {

/**
* Notified of completeness.
*
* <p>
* If you want N handlers for when the promise gets called back use whenComplete instead of
* {@code then} or {@code thenRef}.
*
* <p>
* There can be many {@code whenComplete} handlers.
*
* <p>
* This does not create a new promise.
*
* @param doneListener doneListener
Expand All @@ -65,15 +64,14 @@ default Promise<T> freeze() {

/**
* If a result is sent, and there was no error, then handle the result as a value which could be null.
*
* <p>
* There is only one thenRef handler per promise.
*
* <p>
* Unlike ES6, {@code thenRef(..)} cannot be chained per se as it does not create a new promise,
* but {@code whenComplete(..)}, and {@code }thenMap(...)} can be chained.
*
* <p>
* This does not create a new promise.
*
*
* @param consumer executed if result has no error.
* @return this, fluent API
* @throws NullPointerException if result is present and {@code consumer} is
Expand All @@ -86,7 +84,7 @@ default Promise<T> freeze() {
* This method can be chained, and it creates a new promise, which can be a different type.
*
* @param mapper mapper function
* @param <U> new type for new promise
* @param <U> new type for new promise
* @return a promise that uses mapper function to map old promise result to new result.
*/
<U> Promise<U> thenMap(Function<? super T, ? extends U> mapper);
Expand Down

0 comments on commit d874dfe

Please sign in to comment.