Callback used to chain a deferred with another one.
| 830 | * Callback used to chain a deferred with another one. |
| 831 | */ |
| 832 | private static final class Chain<T> implements Callback<T, T> { |
| 833 | private final Deferred<T> other; |
| 834 | |
| 835 | /** |
| 836 | * Constructor. |
| 837 | * @param other The other deferred to chain with. |
| 838 | */ |
| 839 | public Chain(final Deferred<T> other) { |
| 840 | this.other = other; |
| 841 | } |
| 842 | |
| 843 | public T call(final T arg) { |
| 844 | other.callback(arg); |
| 845 | return arg; |
| 846 | } |
| 847 | |
| 848 | public String toString() { |
| 849 | return "chain with Deferred@" + other.hashCode(); |
| 850 | } |
| 851 | }; |
| 852 | |
| 853 | /** |
| 854 | * Groups multiple {@code Deferred}s together in a single one. |
nothing calls this directly
no outgoing calls
no test coverage detected