Fix javadoc (#218)

* github/workflow/build: verify javadoc

* github/workflow/deploy: only publish javadoc after successful deploy to sonatype

* result: fix javadoc

* result: fix javadoc (jdk 16 flagged)
This commit is contained in:
Paul Campbell 2021-08-05 08:07:02 +01:00 committed by GitHub
parent b9c990b0d7
commit 74b3ea92b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 29 deletions

View file

@ -21,3 +21,5 @@ jobs:
java-version: ${{ matrix.java }}
- name: build-jar
run: mvn -B install
- name: verify javadoc
run: mvn -P release javadoc:javadoc

View file

@ -38,16 +38,6 @@ jobs:
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
javadoc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2.1.0
with:
distribution: adopt
java-version: 16
- name: create-javadoc
run: mvn -B javadoc:javadoc
- name: Publish Javadoc
uses: JamesIves/github-pages-deploy-action@4.1.4
with:

View file

@ -28,7 +28,7 @@ public interface BaseResult {
* Checks if the Result is a success.
*
* <pre><code>
* boolean isOkay = Result.of(() -> getValue())
* boolean isOkay = Result.of(() -&gt; getValue())
* .isOkay();
* </code></pre>
*
@ -49,8 +49,8 @@ public interface BaseResult {
*
* <pre><code>
* void handleError(Throwable e) {...}
* Result.of(() -> doSomething())
* .onError(e -> handleError(e));
* Result.of(() -&gt; doSomething())
* .onError(e -&gt; handleError(e));
* </code></pre>
*
* @param errorConsumer the consumer to handle the error

View file

@ -4,6 +4,9 @@ import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Function;
/**
* An Error Result with no value type.
*/
public class ErrVoid implements ResultVoid {
private final Throwable error;

View file

@ -607,8 +607,8 @@ public interface Result<T> extends BaseResult, ThrowableFunctor<T, ThrowableFunc
* otherwise returns a new {@code Result} with the existing error.
*
* <pre><code>
* ResultVoid result = Result.of(() -> getValue())
* .flatMapV(v -> Result.ok());
* ResultVoid result = Result.of(() -&gt; getValue())
* .flatMapV(v -&gt; Result.ok());
* </code></pre>
*
* @param f the mapping function the produces a ResultVoid
@ -648,10 +648,10 @@ public interface Result<T> extends BaseResult, ThrowableFunctor<T, ThrowableFunc
* Consumer with the value or error.
*
* <pre><code>
* Result.of(()-> getValue())
* Result.of(()-&gt; getValue())
* .match(
* success -> doSomething(success),
* error -> handleError(error)
* success -&gt; doSomething(success),
* error -&gt; handleError(error)
* );
* </code></pre>
*
@ -683,7 +683,7 @@ public interface Result<T> extends BaseResult, ThrowableFunctor<T, ThrowableFunc
*
* <pre><code>
* Result&lt;Integer&gt; result = Result.of(() -&gt; getValue())
* .recover(e -> Result.of(() -&gt; getSafeValue(e)));
* .recover(e -&gt; Result.of(() -&gt; getSafeValue(e)));
* </code></pre>
*
* @param f the function to recover from the error
@ -699,8 +699,8 @@ public interface Result<T> extends BaseResult, ThrowableFunctor<T, ThrowableFunc
*
* <pre><code>
* void handleSuccess(Integer value) {...}
* Result.of(() -> getValue())
* .onSuccess(v -> handleSuccess(v));
* Result.of(() -&gt; getValue())
* .onSuccess(v -&gt; handleSuccess(v));
* </code></pre>
*
* <p>When this is a success then tne Consumer will be supplied with the

View file

@ -20,8 +20,8 @@ public interface ResultVoid extends BaseResult {
* <pre><code>
* Result.ok()
* .match(
* () -> doSomething(),
* error -> handleError(error)
* () -&gt; doSomething(),
* error -&gt; handleError(error)
* );
* </code></pre>
*
@ -39,8 +39,8 @@ public interface ResultVoid extends BaseResult {
*
* <pre><code>
* void doSomethingRisky(String s) throws Exception {...}
* ResultVoid result = Result.ofVoid(() -> doSomethingRisky("first"))
* .recover(e -> Result.ofVoid(() -> doSomethingRisky("second")));
* ResultVoid result = Result.ofVoid(() -&gt; doSomethingRisky("first"))
* .recover(e -&gt; Result.ofVoid(() -&gt; doSomethingRisky("second")));
* </code></pre>
*
* @param f the function to recover from the error
@ -58,8 +58,8 @@ public interface ResultVoid extends BaseResult {
* <pre><code>
* void doSomethingRisky() throws Exception {...}
* void handleSuccess() {...}
* Result.ofVoid(() -> doSomethingRisky()) // ResultVoid
* .onSuccess(() -> handleSuccess());
* Result.ofVoid(() -&gt; doSomethingRisky()) // ResultVoid
* .onSuccess(() -&gt; handleSuccess());
* </code></pre>
*
* <p>When this is a success then tne Consumer will be supplied with the

View file

@ -7,8 +7,10 @@ import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Function;
/**
* The Successful Result, with no value.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public class SuccessVoid implements ResultVoid {
private static final ResultVoid INSTANCE = new SuccessVoid();

View file

@ -20,7 +20,7 @@
*/
/**
* <h1>Result</h1>
* &lt;h1&gt;Result&lt;/h1&gt;
*
* Allows handling error conditions without the need to {@code catch}
* exceptions.