|
41 | 41 | */ |
42 | 42 | public interface Promise<T> extends Future<T>, CompletionStage<T> { |
43 | 43 |
|
44 | | - default public T getNow(T valueIfAbsent) { |
| 44 | + default T getNow(T valueIfAbsent) { |
45 | 45 | return getNow(() -> valueIfAbsent); |
46 | 46 | } |
47 | 47 |
|
48 | | - default public T getNow(Supplier<? extends T> valueIfAbsent) { |
| 48 | + default T getNow(Supplier<? extends T> valueIfAbsent) { |
49 | 49 | if (isDone()) { |
50 | 50 | try { |
51 | 51 | return get(); |
@@ -138,86 +138,86 @@ default DependentPromise<T> dependent() { |
138 | 138 | return DependentPromise.from(this); |
139 | 139 | } |
140 | 140 |
|
141 | | - public <U> Promise<U> thenApply(Function<? super T, ? extends U> fn); |
| 141 | + <U> Promise<U> thenApply(Function<? super T, ? extends U> fn); |
142 | 142 |
|
143 | | - public <U> Promise<U> thenApplyAsync(Function<? super T, ? extends U> fn); |
| 143 | + <U> Promise<U> thenApplyAsync(Function<? super T, ? extends U> fn); |
144 | 144 |
|
145 | | - public <U> Promise<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor); |
| 145 | + <U> Promise<U> thenApplyAsync(Function<? super T, ? extends U> fn, Executor executor); |
146 | 146 |
|
147 | | - public Promise<Void> thenAccept(Consumer<? super T> action); |
| 147 | + Promise<Void> thenAccept(Consumer<? super T> action); |
148 | 148 |
|
149 | | - public Promise<Void> thenAcceptAsync(Consumer<? super T> action); |
| 149 | + Promise<Void> thenAcceptAsync(Consumer<? super T> action); |
150 | 150 |
|
151 | | - public Promise<Void> thenAcceptAsync(Consumer<? super T> action, Executor executor); |
| 151 | + Promise<Void> thenAcceptAsync(Consumer<? super T> action, Executor executor); |
152 | 152 |
|
153 | | - public Promise<Void> thenRun(Runnable action); |
| 153 | + Promise<Void> thenRun(Runnable action); |
154 | 154 |
|
155 | | - public Promise<Void> thenRunAsync(Runnable action); |
| 155 | + Promise<Void> thenRunAsync(Runnable action); |
156 | 156 |
|
157 | | - public Promise<Void> thenRunAsync(Runnable action, Executor executor); |
| 157 | + Promise<Void> thenRunAsync(Runnable action, Executor executor); |
158 | 158 |
|
159 | | - public <U, V> Promise<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn); |
| 159 | + <U, V> Promise<V> thenCombine(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn); |
160 | 160 |
|
161 | | - public <U, V> Promise<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn); |
| 161 | + <U, V> Promise<V> thenCombineAsync(CompletionStage<? extends U> other, BiFunction<? super T, ? super U, ? extends V> fn); |
162 | 162 |
|
163 | | - public <U, V> Promise<V> thenCombineAsync(CompletionStage<? extends U> other, |
| 163 | + <U, V> Promise<V> thenCombineAsync(CompletionStage<? extends U> other, |
164 | 164 | BiFunction<? super T, ? super U, ? extends V> fn, |
165 | 165 | Executor executor); |
166 | 166 |
|
167 | | - public <U> Promise<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action); |
| 167 | + <U> Promise<Void> thenAcceptBoth(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action); |
168 | 168 |
|
169 | | - public <U> Promise<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action); |
| 169 | + <U> Promise<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, BiConsumer<? super T, ? super U> action); |
170 | 170 |
|
171 | | - public <U> Promise<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, |
| 171 | + <U> Promise<Void> thenAcceptBothAsync(CompletionStage<? extends U> other, |
172 | 172 | BiConsumer<? super T, ? super U> action, |
173 | 173 | Executor executor); |
174 | 174 |
|
175 | | - public Promise<Void> runAfterBoth(CompletionStage<?> other, Runnable action); |
| 175 | + Promise<Void> runAfterBoth(CompletionStage<?> other, Runnable action); |
176 | 176 |
|
177 | | - public Promise<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action); |
| 177 | + Promise<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action); |
178 | 178 |
|
179 | | - public Promise<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor); |
| 179 | + Promise<Void> runAfterBothAsync(CompletionStage<?> other, Runnable action, Executor executor); |
180 | 180 |
|
181 | | - public <U> Promise<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn); |
| 181 | + <U> Promise<U> applyToEither(CompletionStage<? extends T> other, Function<? super T, U> fn); |
182 | 182 |
|
183 | | - public <U> Promise<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn); |
| 183 | + <U> Promise<U> applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T, U> fn); |
184 | 184 |
|
185 | | - public <U> Promise<U> applyToEitherAsync(CompletionStage<? extends T> other, |
| 185 | + <U> Promise<U> applyToEitherAsync(CompletionStage<? extends T> other, |
186 | 186 | Function<? super T, U> fn, |
187 | 187 | Executor executor); |
188 | 188 |
|
189 | | - public Promise<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action); |
| 189 | + Promise<Void> acceptEither(CompletionStage<? extends T> other, Consumer<? super T> action); |
190 | 190 |
|
191 | | - public Promise<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action); |
| 191 | + Promise<Void> acceptEitherAsync(CompletionStage<? extends T> other, Consumer<? super T> action); |
192 | 192 |
|
193 | | - public Promise<Void> acceptEitherAsync(CompletionStage<? extends T> other, |
| 193 | + Promise<Void> acceptEitherAsync(CompletionStage<? extends T> other, |
194 | 194 | Consumer<? super T> action, |
195 | 195 | Executor executor); |
196 | 196 |
|
197 | | - public Promise<Void> runAfterEither(CompletionStage<?> other, Runnable action); |
| 197 | + Promise<Void> runAfterEither(CompletionStage<?> other, Runnable action); |
198 | 198 |
|
199 | | - public Promise<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action); |
| 199 | + Promise<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action); |
200 | 200 |
|
201 | | - public Promise<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor); |
| 201 | + Promise<Void> runAfterEitherAsync(CompletionStage<?> other, Runnable action, Executor executor); |
202 | 202 |
|
203 | | - public <U> Promise<U> thenCompose(Function<? super T, ? extends CompletionStage<U>> fn); |
| 203 | + <U> Promise<U> thenCompose(Function<? super T, ? extends CompletionStage<U>> fn); |
204 | 204 |
|
205 | | - public <U> Promise<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn); |
| 205 | + <U> Promise<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn); |
206 | 206 |
|
207 | | - public <U> Promise<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor); |
| 207 | + <U> Promise<U> thenComposeAsync(Function<? super T, ? extends CompletionStage<U>> fn, Executor executor); |
208 | 208 |
|
209 | | - public Promise<T> exceptionally(Function<Throwable, ? extends T> fn); |
| 209 | + Promise<T> exceptionally(Function<Throwable, ? extends T> fn); |
210 | 210 |
|
211 | | - public Promise<T> whenComplete(BiConsumer<? super T, ? super Throwable> action); |
| 211 | + Promise<T> whenComplete(BiConsumer<? super T, ? super Throwable> action); |
212 | 212 |
|
213 | | - public Promise<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action); |
| 213 | + Promise<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action); |
214 | 214 |
|
215 | | - public Promise<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor); |
| 215 | + Promise<T> whenCompleteAsync(BiConsumer<? super T, ? super Throwable> action, Executor executor); |
216 | 216 |
|
217 | | - public <U> Promise<U> handle(BiFunction<? super T, Throwable, ? extends U> fn); |
| 217 | + <U> Promise<U> handle(BiFunction<? super T, Throwable, ? extends U> fn); |
218 | 218 |
|
219 | | - public <U> Promise<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn); |
| 219 | + <U> Promise<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn); |
220 | 220 |
|
221 | | - public <U> Promise<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor); |
| 221 | + <U> Promise<U> handleAsync(BiFunction<? super T, Throwable, ? extends U> fn, Executor executor); |
222 | 222 |
|
223 | 223 | } |
0 commit comments