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

Method forResult

Bolts/src/bolts/Task.java:168–172  ·  view source on GitHub ↗

Creates a completed task with the given value.

(TResult value)

Source from the content-addressed store, hash-verified

166 * Creates a completed task with the given value.
167 */
168 public static <TResult> Task<TResult> forResult(TResult value) {
169 Task<TResult>.TaskCompletionSource tcs = Task.<TResult> create();
170 tcs.setResult(value);
171 return tcs.getTask();
172 }
173
174 /**
175 * Creates a faulted task with the given error.

Callers 9

testPrimitivesMethod · 0.95
thenMethod · 0.95
callMethod · 0.95
testOnSuccessMethod · 0.95
testOnSuccessTaskMethod · 0.95
thenMethod · 0.95
whenAllMethod · 0.95

Calls 3

createMethod · 0.95
setResultMethod · 0.80
getTaskMethod · 0.80

Tested by 7

testPrimitivesMethod · 0.76
thenMethod · 0.76
callMethod · 0.76
testOnSuccessMethod · 0.76
testOnSuccessTaskMethod · 0.76