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 }} java-version: ${{ matrix.java }}
- name: build-jar - name: build-jar
run: mvn -B install 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 }} NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }} GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 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 - name: Publish Javadoc
uses: JamesIves/github-pages-deploy-action@4.1.4 uses: JamesIves/github-pages-deploy-action@4.1.4
with: with:

View file

@ -28,7 +28,7 @@ public interface BaseResult {
* Checks if the Result is a success. * Checks if the Result is a success.
* *
* <pre><code> * <pre><code>
* boolean isOkay = Result.of(() -> getValue()) * boolean isOkay = Result.of(() -&gt; getValue())
* .isOkay(); * .isOkay();
* </code></pre> * </code></pre>
* *
@ -49,8 +49,8 @@ public interface BaseResult {
* *
* <pre><code> * <pre><code>
* void handleError(Throwable e) {...} * void handleError(Throwable e) {...}
* Result.of(() -> doSomething()) * Result.of(() -&gt; doSomething())
* .onError(e -> handleError(e)); * .onError(e -&gt; handleError(e));
* </code></pre> * </code></pre>
* *
* @param errorConsumer the consumer to handle the error * @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.Consumer;
import java.util.function.Function; import java.util.function.Function;
/**
* An Error Result with no value type.
*/
public class ErrVoid implements ResultVoid { public class ErrVoid implements ResultVoid {
private final Throwable error; 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. * otherwise returns a new {@code Result} with the existing error.
* *
* <pre><code> * <pre><code>
* ResultVoid result = Result.of(() -> getValue()) * ResultVoid result = Result.of(() -&gt; getValue())
* .flatMapV(v -> Result.ok()); * .flatMapV(v -&gt; Result.ok());
* </code></pre> * </code></pre>
* *
* @param f the mapping function the produces a ResultVoid * @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. * Consumer with the value or error.
* *
* <pre><code> * <pre><code>
* Result.of(()-> getValue()) * Result.of(()-&gt; getValue())
* .match( * .match(
* success -> doSomething(success), * success -&gt; doSomething(success),
* error -> handleError(error) * error -&gt; handleError(error)
* ); * );
* </code></pre> * </code></pre>
* *
@ -683,7 +683,7 @@ public interface Result<T> extends BaseResult, ThrowableFunctor<T, ThrowableFunc
* *
* <pre><code> * <pre><code>
* Result&lt;Integer&gt; result = Result.of(() -&gt; getValue()) * 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> * </code></pre>
* *
* @param f the function to recover from the error * @param f the function to recover from the error
@ -699,8 +699,8 @@ public interface Result<T> extends BaseResult, ThrowableFunctor<T, ThrowableFunc
* *
* <pre><code> * <pre><code>
* void handleSuccess(Integer value) {...} * void handleSuccess(Integer value) {...}
* Result.of(() -> getValue()) * Result.of(() -&gt; getValue())
* .onSuccess(v -> handleSuccess(v)); * .onSuccess(v -&gt; handleSuccess(v));
* </code></pre> * </code></pre>
* *
* <p>When this is a success then tne Consumer will be supplied with the * <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> * <pre><code>
* Result.ok() * Result.ok()
* .match( * .match(
* () -> doSomething(), * () -&gt; doSomething(),
* error -> handleError(error) * error -&gt; handleError(error)
* ); * );
* </code></pre> * </code></pre>
* *
@ -39,8 +39,8 @@ public interface ResultVoid extends BaseResult {
* *
* <pre><code> * <pre><code>
* void doSomethingRisky(String s) throws Exception {...} * void doSomethingRisky(String s) throws Exception {...}
* ResultVoid result = Result.ofVoid(() -> doSomethingRisky("first")) * ResultVoid result = Result.ofVoid(() -&gt; doSomethingRisky("first"))
* .recover(e -> Result.ofVoid(() -> doSomethingRisky("second"))); * .recover(e -&gt; Result.ofVoid(() -&gt; doSomethingRisky("second")));
* </code></pre> * </code></pre>
* *
* @param f the function to recover from the error * @param f the function to recover from the error
@ -58,8 +58,8 @@ public interface ResultVoid extends BaseResult {
* <pre><code> * <pre><code>
* void doSomethingRisky() throws Exception {...} * void doSomethingRisky() throws Exception {...}
* void handleSuccess() {...} * void handleSuccess() {...}
* Result.ofVoid(() -> doSomethingRisky()) // ResultVoid * Result.ofVoid(() -&gt; doSomethingRisky()) // ResultVoid
* .onSuccess(() -> handleSuccess()); * .onSuccess(() -&gt; handleSuccess());
* </code></pre> * </code></pre>
* *
* <p>When this is a success then tne Consumer will be supplied with the * <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.Consumer;
import java.util.function.Function; import java.util.function.Function;
/**
* The Successful Result, with no value.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE) @NoArgsConstructor(access = AccessLevel.PRIVATE)
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
public class SuccessVoid implements ResultVoid { public class SuccessVoid implements ResultVoid {
private static final ResultVoid INSTANCE = new SuccessVoid(); 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} * Allows handling error conditions without the need to {@code catch}
* exceptions. * exceptions.