Skip to content

Commit

Permalink
docs: improve javadoc 📚
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Apr 24, 2024
1 parent cda112e commit bc95606
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions cffu-core/src/main/java/io/foldright/cffu/Cffu.java
Original file line number Diff line number Diff line change
Expand Up @@ -1330,7 +1330,7 @@ public T join() {
* Waits if necessary for at most the given time for the computation to complete,
* and then retrieves its result value when complete, or throws an (unchecked) exception if completed exceptionally.
* <p>
* <b><i>NOTE:<br></i></b>
* <strong>NOTE:<br></strong>
* call this method
* <p>
* {@code result = cffu.join(timeout, unit);}
Expand All @@ -1342,7 +1342,7 @@ public T join() {
* .join();
* }</pre>
*
* <b><i>CAUTION:<br></i></b>
* <strong>CAUTION:<br></strong>
* if the wait timed out, this method throws an (unchecked) {@link CompletionException}
* with the {@link TimeoutException} as its cause;
* NOT throws a (checked) {@link TimeoutException} like {@link #get(long, TimeUnit)}.
Expand Down Expand Up @@ -1482,7 +1482,7 @@ public boolean isCancelled() {
* Returns the computation state, this method just invoke without java version compatibility logic,
* if you need this function backport into old {@code java 18-}, use {@link #cffuState()} instead.
* <p>
* <b><i>NOTE:<br></i></b>
* <strong>NOTE:<br></strong>
* {@link CompletableFuture#state} is new method since Java 19,
* this method should have compatibility logic for old Java version;
* But the return type {@link Future.State} is also added since Java 19,
Expand Down Expand Up @@ -1610,7 +1610,7 @@ public boolean cancel(boolean mayInterruptIfRunning) {
* If this CompletableFuture completes exceptionally, then the returned CompletionStage completes
* exceptionally with a CompletionException with this exception as cause.
* <p>
* <b><i>CAUTION:<br></i></b>
* <strong>CAUTION:<br></strong>
* if run on old Java 8, just return a Cffu with
* a *normal* underlying CompletableFuture which is NOT with a *minimal* CompletionStage.
* <p>
Expand Down Expand Up @@ -1839,11 +1839,11 @@ public void obtrudeException(Throwable ex) {
* Subclasses of CompletableFuture should normally override this method to return an instance of the same class
* as this CompletableFuture. The default implementation returns an instance of class CompletableFuture.
* <p>
* <b><i>NOTE:<br></i></b>
* <strong>NOTE:<br></strong>
* this method existed mainly for API compatibility to {@code CompletableFuture},
* prefer {@link CffuFactory#newIncompleteCffu()}.
* <p>
* <b><i>CAUTION:<br></i></b>
* <storng>CAUTION:<br></storng>
* for minimal stage instance({@link #isMinimalStage()}), if run on old Java 8,
* just return a Cffu with a *normal* underlying CompletableFuture which is NOT with a *minimal* CompletionStage.
*
Expand Down
6 changes: 3 additions & 3 deletions cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public <T> Cffu<T> completedFuture(@Nullable T value) {
* Returns a new CompletionStage that is already completed with the given value
* and supports only those methods in interface {@link CompletionStage}.
* <p>
* <b><i>CAUTION:<br></i></b>
* <strong>CAUTION:<br></strong>
* if run on old Java 8, just return a Cffu with
* a *normal* underlying CompletableFuture which is NOT with a *minimal* CompletionStage.
*
Expand Down Expand Up @@ -124,7 +124,7 @@ public <T> Cffu<T> failedFuture(Throwable ex) {
* Returns a new CompletionStage that is already completed exceptionally
* with the given exception and supports only those methods in interface {@link CompletionStage}.
* <p>
* <b><i>CAUTION:<br></i></b>
* <strong>CAUTION:<br></strong>
* if run on old Java 8, just return a Cffu with
* a *normal* underlying CompletableFuture which is NOT with a *minimal* CompletionStage.
*
Expand Down Expand Up @@ -247,7 +247,7 @@ public <T> Cffu<T> newIncompleteCffu() {
* for {@link CompletableFuture} class instances,
* {@link Cffu#cffuUnwrap()} is the inverse operation to this method.
* <p>
* <b><i>NOTE</i></b>, keep input stage unchanged if possible when wrap:<br>
* <strong>NOTE:</strong>, keep input stage unchanged if possible when wrap:<br>
* <ol>
* <li>if input stage is a {@link Cffu}, re-wrapped with the config of
* this {@link CffuFactory} from {@link CffuFactoryBuilder} by {@link Cffu#resetCffuFactory(CffuFactory)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


/**
* This class contains the enhanced methods for {@link CompletableFuture}.
* This class contains the enhanced and backport methods for {@link CompletableFuture}.
*
* @author Jerry Lee (oldratlee at gmail dot com)
*/
Expand Down Expand Up @@ -462,8 +462,8 @@ public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1, T2, T3, T4, T5>>
}

////////////////////////////////////////////////////////////////////////////////
//# Backport CF methods
// compatibility for low Java version
//# Backport CF static methods
// compatibility for low Java versions
////////////////////////////////////////////////////////////////////////////////

//# Factory methods
Expand All @@ -489,7 +489,7 @@ public static <T> CompletableFuture<T> failedFuture(Throwable ex) {
* Returns a new CompletionStage that is already completed with the given value
* and supports only those methods in interface {@link CompletionStage}.
* <p>
* <b><i>CAUTION:<br></i></b>
* <strong>CAUTION:<br></strong>
* if run on old Java 8, just return a *normal* CompletableFuture which is NOT with a *minimal* CompletionStage.
*
* @param value the value
Expand All @@ -508,7 +508,7 @@ public static <T> CompletionStage<T> completedStage(@Nullable T value) {
* Returns a new CompletionStage that is already completed exceptionally with
* the given exception and supports only those methods in interface {@link CompletionStage}.
* <p>
* <b><i>CAUTION:<br></i></b>
* <strong>CAUTION:<br></strong>
* if run on old Java 8, just return a *normal* CompletableFuture which is NOT with a *minimal* CompletionStage.
*
* @param ex the exception
Expand Down Expand Up @@ -562,7 +562,7 @@ public static Executor delayedExecutor(long delay, TimeUnit unit, Executor execu
}

////////////////////////////////////////
//# backport instance methods
//# Backport CF instance methods
////////////////////////////////////////

//# Error Handling methods of CompletionStage
Expand Down Expand Up @@ -718,7 +718,7 @@ public static <T> CompletableFuture<T> exceptionallyComposeAsync(
* Waits if necessary for at most the given time for the computation to complete,
* and then retrieves its result value when complete, or throws an (unchecked) exception if completed exceptionally.
* <p>
* <b><i>NOTE:<br></i></b>
* <strong>NOTE:<br></strong>
* call this method
* <p>
* {@code result = CompletableFutureUtils.join(cf, timeout, unit);}
Expand All @@ -730,7 +730,7 @@ public static <T> CompletableFuture<T> exceptionallyComposeAsync(
* .join();
* }</pre>
*
* <b><i>CAUTION:<br></i></b>
* <strong>CAUTION:<br></strong>
* if the wait timed out, this method throws an (unchecked) {@link CompletionException}
* with the {@link TimeoutException} as its cause;
* NOT throws a (checked) {@link TimeoutException} like {@link CompletableFuture#get(long, TimeUnit)}.
Expand Down Expand Up @@ -913,7 +913,7 @@ public static <T> CompletableFuture<T> completeAsync(
* If given CompletableFuture completes exceptionally, then the returned CompletionStage completes exceptionally
* with a CompletionException with given exception as cause.
* <p>
* <b><i>CAUTION:<br></i></b>
* <strong>CAUTION:<br></strong>
* if run on old Java 8, just return a *normal* CompletableFuture which is NOT with a *minimal* CompletionStage.
*
* @return the new CompletionStage
Expand Down Expand Up @@ -963,7 +963,7 @@ public static <T, U> CompletableFuture<U> newIncompleteFuture(CompletableFuture<
* Returns the default Executor used for async methods that do not specify an Executor.
* This class uses the {@link ForkJoinPool#commonPool()} if it supports more than one parallel thread,
* or else an Executor using one thread per async task.<br>
* <b><i>CAUTION:</i></b>This executor may be not suitable for common biz use(io intensive).
* <strong>CAUTION:</strong>This executor may be not suitable for common biz use(io intensive).
*
* @return the executor
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ fun <T> CompletableFuture<T>.exceptionallyComposeAsync(
* Waits if necessary for at most the given time for the computation to complete,
* and then retrieves its result value when complete, or throws an (unchecked) exception if completed exceptionally.
* <p>
* <b><i>NOTE:<br></i></b>
* <strong>NOTE:<br></strong>
* call this method
*
* `result = CompletableFutureUtils.join(cf, timeout, unit);`
Expand All @@ -506,7 +506,7 @@ fun <T> CompletableFuture<T>.exceptionallyComposeAsync(
* }
* ```
*
* <b><i>CAUTION:<br></i></b>
* <strong>CAUTION:<br></strong>
* if the wait timed out, this method throws an (unchecked) CompletionException with the TimeoutException as its cause;
* NOT throws a (checked) TimeoutException like [CompletableFuture.get].
*
Expand Down

0 comments on commit bc95606

Please sign in to comment.