Skip to content

Commit

Permalink
docs: fix break NoCfsProvidedException links in CffuExtensions.kt
Browse files Browse the repository at this point in the history
…; improve api docs
  • Loading branch information
oldratlee committed Apr 14, 2023
1 parent 6f822c3 commit b983873
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 31 deletions.
8 changes: 4 additions & 4 deletions src/main/java/io/foldright/cffu/CffuFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public Cffu<Object> anyOf() {
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given Cffu as its cause. If no Cffu are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* with a CompletionException holding a {@link NoCfsProvidedException} as its cause.
*
* @param cfs the Cffus
* @return a new Cffu
Expand All @@ -467,7 +467,7 @@ public Cffu<Object> anyOfSuccess(Cffu<?>... cfs) {
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* with a CompletionException holding a {@link NoCfsProvidedException} as its cause.
*
* @param cfs the CompletableFutures
* @return a new Cffu
Expand Down Expand Up @@ -649,7 +649,7 @@ public <T> Cffu<T> cffuAnyOf() {
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given Cffu as its cause. If no Cffu are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* with a CompletionException holding a {@link NoCfsProvidedException} as its cause.
*
* @param cfs the Cffus
* @return a new Cffu
Expand All @@ -667,7 +667,7 @@ public final <T> Cffu<T> cffuAnyOfSuccess(Cffu<T>... cfs) {
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* with a CompletionException holding a {@link NoCfsProvidedException} as its cause.
*
* @param cfs the CompletableFutures
* @return a new Cffu
Expand Down
16 changes: 14 additions & 2 deletions src/main/java/io/foldright/cffu/CompletableFutureUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
@ParametersAreNonnullByDefault
@ReturnValuesAreNonnullByDefault
public final class CompletableFutureUtils {
////////////////////////////////////////////////////////////////////////////////
//# allOf* methods
////////////////////////////////////////////////////////////////////////////////

/**
* Returns a new CompletableFuture with the result of all the given CompletableFutures,
* the new CompletableFuture is completed when all the given CompletableFutures complete.
Expand Down Expand Up @@ -163,6 +167,10 @@ private static void fill(CompletableFuture[] cfs,
}
}

////////////////////////////////////////////////////////////////////////////////
//# anyOf* methods
////////////////////////////////////////////////////////////////////////////////

/**
* Returns a new CompletableFuture that is completed
* when any of the given CompletableFutures complete, with the same result.
Expand Down Expand Up @@ -190,7 +198,7 @@ public static <T> CompletableFuture<T> anyOfWithType(CompletableFuture<T>... cfs
* the returned CompletableFuture also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new CompletableFuture that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* with a CompletionException holding a {@link NoCfsProvidedException} as its cause.
*
* @param cfs the CompletableFutures
* @return a new CompletableFuture that success
Expand Down Expand Up @@ -224,7 +232,7 @@ public static CompletableFuture<Object> anyOfSuccess(CompletableFuture<?>... cfs
* the returned CompletableFuture also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new CompletableFuture that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* with a CompletionException holding a {@link NoCfsProvidedException} as its cause.
* <p>
* Same as {@link #anyOfSuccess(CompletableFuture[])},
* but return result type is specified type instead of {@code Object}.
Expand All @@ -242,6 +250,10 @@ public static <T> CompletableFuture<T> anyOfSuccessWithType(CompletableFuture<T>
return (CompletableFuture<T>) anyOfSuccess(cfs);
}

////////////////////////////////////////////////////////////////////////////////
//# combine methods
////////////////////////////////////////////////////////////////////////////////

/**
* Returns a new CompletableFuture that is completed when the given two CompletableFutures complete.
* If any of the given CompletableFutures complete exceptionally, then the returned
Expand Down
50 changes: 25 additions & 25 deletions src/main/java/io/foldright/cffu/kotlin/CffuExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ fun Array<CompletableFuture<*>>.anyOfCompletableFutureAny(): CompletableFuture<A
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned CompletableFuture also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new CompletableFuture that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new CompletableFuture that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CompletableFutureUtils.anyOfSuccessWithType], providing this method is convenient for method chaining.
*
Expand All @@ -158,8 +158,8 @@ fun <T> Collection<CompletableFuture<T>>.anyOfSuccessCompletableFuture(): Comple
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned CompletableFuture also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new CompletableFuture that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new CompletableFuture that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CompletableFutureUtils.anyOfSuccess], providing this method is convenient for method chaining.
*
Expand All @@ -174,8 +174,8 @@ fun <T> Array<CompletableFuture<T>>.anyOfSuccessCompletableFuture(): Completable
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned CompletableFuture also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new CompletableFuture that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new CompletableFuture that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CompletableFutureUtils.anyOfSuccess], providing this method is convenient for method chaining.
*
Expand All @@ -190,9 +190,9 @@ fun Collection<CompletableFuture<*>>.anyOfSuccessCompletableFutureAny(): Complet
* Returns a new CompletableFuture that success when any of the given CompletableFutures success,
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned CompletableFuture also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new CompletableFuture that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* an exception CompletableFuture any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new Cffu that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CompletableFutureUtils.anyOfSuccessWithType], providing this method is convenient for method chaining.
*
Expand Down Expand Up @@ -535,8 +535,8 @@ fun Array<CompletableFuture<*>>.anyOfCffuAny(cffuFactory: CffuFactory): Cffu<Any
* with the same result. Otherwise, all the given Cffus complete exceptionally,
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given Cffus as its cause. If no Cffus are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new Cffu that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CffuFactory.cffuAnyOfSuccess], providing this method is convenient for method chaining.
*
Expand All @@ -551,8 +551,8 @@ fun <T> Collection<Cffu<T>>.anyOfSuccessCffu(cffuFactory: CffuFactory): Cffu<T>
* with the same result. Otherwise, all the given Cffus complete exceptionally,
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given Cffus as its cause. If no Cffus are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new Cffu that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CffuFactory.cffuAnyOfSuccess], providing this method is convenient for method chaining.
*
Expand All @@ -567,8 +567,8 @@ fun <T> Array<Cffu<T>>.anyOfSuccessCffu(cffuFactory: CffuFactory): Cffu<T> =
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new Cffu that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CffuFactory.cffuAnyOfSuccess], providing this method is convenient for method chaining.
*
Expand All @@ -584,8 +584,8 @@ fun <T> Collection<CompletableFuture<T>>.anyOfSuccessCffu(cffuFactory: CffuFacto
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new Cffu that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CffuFactory.cffuAnyOfSuccess], providing this method is convenient for method chaining.
*
Expand All @@ -600,8 +600,8 @@ fun <T> Array<CompletableFuture<T>>.anyOfSuccessCffu(cffuFactory: CffuFactory):
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new Cffu that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CffuFactory.anyOfSuccess], providing this method is convenient for method chaining.
*
Expand All @@ -616,8 +616,8 @@ fun Collection<Cffu<*>>.anyOfSuccessCffuAny(cffuFactory: CffuFactory): Cffu<Any>
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new Cffu that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CffuFactory.anyOfSuccess], providing this method is convenient for method chaining.
*
Expand All @@ -632,8 +632,8 @@ fun Array<Cffu<*>>.anyOfSuccessCffuAny(cffuFactory: CffuFactory): Cffu<Any> =
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new Cffu that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CffuFactory.anyOfSuccess], providing this method is convenient for method chaining.
*
Expand All @@ -649,8 +649,8 @@ fun Collection<CompletableFuture<*>>.anyOfSuccessCffuAny(cffuFactory: CffuFactor
* with the same result. Otherwise, all the given CompletableFutures complete exceptionally,
* the returned Cffu also does so, with a CompletionException holding
* an exception from any of the given CompletableFutures as its cause. If no CompletableFutures are provided,
* returns a new Cffu that is already completed exceptionally
* with a CompletionException holding a {@link NoCfsProvidedException} exception as its cause.
* returns a new Cffu that is already completed exceptionally with a CompletionException
* holding a [NoCfsProvidedException][io.foldright.cffu.NoCfsProvidedException] as its cause.
*
* Same as [CffuFactory.anyOfSuccess], providing this method is convenient for method chaining.
*
Expand Down

0 comments on commit b983873

Please sign in to comment.