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:
parent
b9c990b0d7
commit
74b3ea92b0
8 changed files with 26 additions and 29 deletions
2
.github/workflows/build-maven.yml
vendored
2
.github/workflows/build-maven.yml
vendored
|
@ -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
|
||||||
|
|
10
.github/workflows/deploy-sonatype.yml
vendored
10
.github/workflows/deploy-sonatype.yml
vendored
|
@ -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:
|
||||||
|
|
|
@ -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(() -> 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(() -> doSomething())
|
||||||
* .onError(e -> handleError(e));
|
* .onError(e -> handleError(e));
|
||||||
* </code></pre>
|
* </code></pre>
|
||||||
*
|
*
|
||||||
* @param errorConsumer the consumer to handle the error
|
* @param errorConsumer the consumer to handle the error
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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(() -> getValue())
|
||||||
* .flatMapV(v -> Result.ok());
|
* .flatMapV(v -> 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(()-> getValue())
|
||||||
* .match(
|
* .match(
|
||||||
* success -> doSomething(success),
|
* success -> doSomething(success),
|
||||||
* error -> handleError(error)
|
* error -> handleError(error)
|
||||||
* );
|
* );
|
||||||
* </code></pre>
|
* </code></pre>
|
||||||
*
|
*
|
||||||
|
@ -683,7 +683,7 @@ public interface Result<T> extends BaseResult, ThrowableFunctor<T, ThrowableFunc
|
||||||
*
|
*
|
||||||
* <pre><code>
|
* <pre><code>
|
||||||
* Result<Integer> result = Result.of(() -> getValue())
|
* Result<Integer> result = Result.of(() -> getValue())
|
||||||
* .recover(e -> Result.of(() -> getSafeValue(e)));
|
* .recover(e -> Result.of(() -> 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(() -> getValue())
|
||||||
* .onSuccess(v -> handleSuccess(v));
|
* .onSuccess(v -> 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
|
||||||
|
|
|
@ -20,8 +20,8 @@ public interface ResultVoid extends BaseResult {
|
||||||
* <pre><code>
|
* <pre><code>
|
||||||
* Result.ok()
|
* Result.ok()
|
||||||
* .match(
|
* .match(
|
||||||
* () -> doSomething(),
|
* () -> doSomething(),
|
||||||
* error -> handleError(error)
|
* error -> 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(() -> doSomethingRisky("first"))
|
||||||
* .recover(e -> Result.ofVoid(() -> doSomethingRisky("second")));
|
* .recover(e -> Result.ofVoid(() -> 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(() -> doSomethingRisky()) // ResultVoid
|
||||||
* .onSuccess(() -> handleSuccess());
|
* .onSuccess(() -> 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
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1>Result</h1>
|
* <h1>Result</h1>
|
||||||
*
|
*
|
||||||
* Allows handling error conditions without the need to {@code catch}
|
* Allows handling error conditions without the need to {@code catch}
|
||||||
* exceptions.
|
* exceptions.
|
||||||
|
|
Loading…
Reference in a new issue