diff options
author | pacien | 2019-04-05 03:17:08 +0200 |
---|---|---|
committer | pacien | 2019-04-05 03:17:08 +0200 |
commit | c63d805583a48e1c28bd8cf6f13858b75fc4c489 (patch) | |
tree | b8292042dfc86cdfb989248494c4ff9c30b3d1c9 /src | |
parent | 0ac555a6d383fa76626a6123e008365e005558a3 (diff) | |
download | java-lemonad-c63d805583a48e1c28bd8cf6f13858b75fc4c489.tar.gz |
style
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/pacien/lemonad/attempt/Attempt.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/pacien/lemonad/attempt/Attempt.java b/src/main/java/org/pacien/lemonad/attempt/Attempt.java index 9f5befa..dcbb2d3 100644 --- a/src/main/java/org/pacien/lemonad/attempt/Attempt.java +++ b/src/main/java/org/pacien/lemonad/attempt/Attempt.java | |||
@@ -55,7 +55,7 @@ public interface Attempt<R, E> { | |||
55 | 55 | ||
56 | /** | 56 | /** |
57 | * @param resultConsumer a {@link Consumer} of result called if the {@link Attempt} is a success. | 57 | * @param resultConsumer a {@link Consumer} of result called if the {@link Attempt} is a success. |
58 | * @return the current {@link Attempt} | 58 | * @return the current {@link Attempt}. |
59 | */ | 59 | */ |
60 | default Attempt<R, E> ifSuccess(@NonNull Consumer<? super R> resultConsumer) { | 60 | default Attempt<R, E> ifSuccess(@NonNull Consumer<? super R> resultConsumer) { |
61 | if (isSuccess()) resultConsumer.accept(getResult()); | 61 | if (isSuccess()) resultConsumer.accept(getResult()); |
@@ -64,7 +64,7 @@ public interface Attempt<R, E> { | |||
64 | 64 | ||
65 | /** | 65 | /** |
66 | * @param errorConsumer a {@link Consumer} of error called if the {@link Attempt} is a failure. | 66 | * @param errorConsumer a {@link Consumer} of error called if the {@link Attempt} is a failure. |
67 | * @return the current {@link Attempt} | 67 | * @return the current {@link Attempt}. |
68 | */ | 68 | */ |
69 | default Attempt<R, E> ifFailure(@NonNull Consumer<? super E> errorConsumer) { | 69 | default Attempt<R, E> ifFailure(@NonNull Consumer<? super E> errorConsumer) { |
70 | if (isFailure()) errorConsumer.accept(getError()); | 70 | if (isFailure()) errorConsumer.accept(getError()); |
@@ -102,7 +102,7 @@ public interface Attempt<R, E> { | |||
102 | 102 | ||
103 | /** | 103 | /** |
104 | * @param mapper a function transforming an {@link Attempt}. | 104 | * @param mapper a function transforming an {@link Attempt}. |
105 | * @return the transformed {@link Attempt} | 105 | * @return the transformed {@link Attempt}. |
106 | */ | 106 | */ |
107 | default <RR, EE> Attempt<RR, EE> flatMap(@NonNull Function<? super Attempt<? super R, ? super E>, ? extends Attempt<? extends RR, ? extends EE>> mapper) { | 107 | default <RR, EE> Attempt<RR, EE> flatMap(@NonNull Function<? super Attempt<? super R, ? super E>, ? extends Attempt<? extends RR, ? extends EE>> mapper) { |
108 | //noinspection unchecked | 108 | //noinspection unchecked |