MCPcopy Create free account
hub / github.com/BoltsFramework/Bolts-Java / makeVoid

Method makeVoid

Bolts/src/bolts/Task.java:205–217  ·  view source on GitHub ↗

Turns a Task into a Task , dropping any result.

()

Source from the content-addressed store, hash-verified

203 * Turns a Task<T> into a Task<Void>, dropping any result.
204 */
205 public Task<Void> makeVoid() {
206 return this.continueWithTask(new Continuation<TResult, Task<Void>>() {
207 public Task<Void> then(Task<TResult> task) throws Exception {
208 if (task.isCancelled()) {
209 return Task.cancelled();
210 }
211 if (task.isFaulted()) {
212 return Task.forError(task.getError());
213 }
214 return Task.forResult(null);
215 }
216 });
217 }
218
219 /**
220 * Invokes the callable on a background thread using the default thread pool, returning a Task to

Callers 1

continueWhileMethod · 0.95

Calls 1

continueWithTaskMethod · 0.95

Tested by

no test coverage detected