diff options
Diffstat (limited to 'src/main/java/org/pacien')
-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 |