MCPcopy Create free account
hub / github.com/traneio/future / Transformer

Interface Transformer

future-java/src/main/java/io/trane/future/Transformer.java:9–26  ·  view source on GitHub ↗

Interface to be used by future.transform. @param the type of the future value. @param the result type of the transformation.

Source from the content-addressed store, hash-verified

7 * @param <U> the result type of the transformation.
8 */
9public interface Transformer<T, U> {
10
11 /**
12 * Transformation called when the future completes with a failure.
13 *
14 * @param ex the failure.
15 * @return the transformed value.
16 */
17 public U onException(Throwable ex);
18
19 /**
20 * Transformation called when the future completes with a value.
21 *
22 * @param value the value.
23 * @return the transformed value.
24 */
25 public U onValue(T value);
26}

Callers

nothing calls this directly

Implementers 8

PromiseTestfuture-java/src/test/java/io/trane/fut
ExceptionFutureTestfuture-java/src/test/java/io/trane/fut
ValueFutureTestfuture-java/src/test/java/io/trane/fut
NoFutureTestfuture-java/src/test/java/io/trane/fut
Promisefuture-java/src/main/java/io/trane/fut
WithinPromisefuture-java/src/main/java/io/trane/fut
JoinPromisefuture-java/src/main/java/io/trane/fut
FirstCompletedOfPromisefuture-java/src/main/java/io/trane/fut

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…