Top Description Inners Fields Constructors Methods
com.google.common.util.concurrent

pack-priv abstract Class AbstractTransformFuture<I extends @Nullable Object, O extends @Nullable Object, F, T extends @Nullable Object>

extends FluentFuture.TrustedFuture<O extends @Nullable Object>
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Known Direct Subclasses
com.google.common.util.concurrent.AbstractTransformFuture.AsyncTransformFuture, com.google.common.util.concurrent.AbstractTransformFuture.TransformFuture
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
@SuppressWarnings:nullness
Static Imports
com.google.common.base.Preconditions.checkNotNull, com.google.common.util.concurrent.Futures.getDone, .MoreExecutors.rejectionPropagatingExecutor, .Platform.restoreInterruptIfIsInterruptedException

Implementations of Futures.transform*.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
pack-priv F
pack-priv ListenableFuture<? extends I>

Constructor Summary

AccessConstructor and Description
pack-priv
AbstractTransformFuture(ListenableFuture<? extends I> inputFuture, F function)

Method Summary

Modifier and TypeMethod and Description
protected final void
afterDone()

Overrides com.google.common.util.concurrent.AbstractFuture.afterDone.

Callback method that is called exactly once after the future is completed.
pack-priv static <I extends @Nullable Object, O extends @Nullable Object> ListenableFuture<O>
create(ListenableFuture<I> input, AsyncFunction<? super I, ? extends O> function, Executor executor)

pack-priv static <I extends @Nullable Object, O extends @Nullable Object> ListenableFuture<O>
create(ListenableFuture<I> input, Function<? super I, ? extends O> function, Executor executor)

pack-priv abstract T
doTransform(F function, I result)

Template method for subtypes to actually run the transform.

protected String
pendingToString()

Overrides com.google.common.util.concurrent.AbstractFuture.pendingToString.

Provide a human-readable explanation of why this future has not yet completed.
public final void
run()

Implements java.lang.Runnable.run.

Runs this operation.
pack-priv abstract void
setResult(T result)

Template method for subtypes to actually set the result.

Inherited from com.google.common.util.concurrent.FluentFuture.TrustedFuture:
addListenercancelgetgetisCancelledisDone

Field Detail

functionback to summary
pack-priv F function
Annotations
@CheckForNull
@LazyInit
inputFutureback to summary
pack-priv ListenableFuture<? extends I> inputFuture
Annotations
@CheckForNull
@LazyInit

Constructor Detail

AbstractTransformFutureback to summary
pack-priv AbstractTransformFuture(ListenableFuture<? extends I> inputFuture, F function)

Method Detail

afterDoneback to summary
protected final void afterDone()

Overrides com.google.common.util.concurrent.AbstractFuture.afterDone.

Doc from com.google.common.util.concurrent.AbstractFuture.afterDone.

Callback method that is called exactly once after the future is completed.

If interruptTask is also run during completion, afterDone runs after it.

The default implementation of this method in AbstractFuture does nothing. This is intended for very lightweight cleanup work, for example, timing statistics or clearing fields. If your task does anything heavier consider, just using a listener with an executor.

Annotations
@Override
createback to summary
pack-priv static <I extends @Nullable Object, O extends @Nullable Object> ListenableFuture<O> create(ListenableFuture<I> input, AsyncFunction<? super I, ? extends O> function, Executor executor)
createback to summary
pack-priv static <I extends @Nullable Object, O extends @Nullable Object> ListenableFuture<O> create(ListenableFuture<I> input, Function<? super I, ? extends O> function, Executor executor)
doTransformback to summary
pack-priv abstract T doTransform(F function, I result) throws Exception

Template method for subtypes to actually run the transform.

Annotations
@ForOverride
@ParametricNullness
pendingToStringback to summary
protected String pendingToString()

Overrides com.google.common.util.concurrent.AbstractFuture.pendingToString.

Doc from com.google.common.util.concurrent.AbstractFuture.pendingToString.

Provide a human-readable explanation of why this future has not yet completed.

Returns:String

null if an explanation cannot be provided (e.g. because the future is done).

Annotations
@Override
@CheckForNull
runback to summary
public final void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
@SuppressWarnings:CatchingUnchecked
setResultback to summary
pack-priv abstract void setResult(T result)

Template method for subtypes to actually set the result.

Annotations
@ForOverride
com.google.common.util.concurrent back to summary

private final Class AbstractTransformFuture.AsyncTransformFuture<I extends @Nullable Object, O extends @Nullable Object>

extends AbstractTransformFuture<I extends @Nullable Object, O extends @Nullable Object, AsyncFunction<? super I extends @Nullable Object, ? extends O extends @Nullable Object>, ListenableFuture<? extends O extends @Nullable Object>>
Class Inheritance

An AbstractTransformFuture that delegates to an AsyncFunction and setFuture(ListenableFuture).

Field Summary

Inherited from com.google.common.util.concurrent.AbstractTransformFuture:
functioninputFuture

Constructor Summary

AccessConstructor and Description
pack-priv
AsyncTransformFuture(ListenableFuture<? extends I> inputFuture, AsyncFunction<? super I, ? extends O> function)

Method Summary

Modifier and TypeMethod and Description
pack-priv ListenableFuture<? extends O>
doTransform(AsyncFunction<? super I, ? extends O> function, I input)

Implements abstract com.google.common.util.concurrent.AbstractTransformFuture.doTransform.

Template method for subtypes to actually run the transform.
pack-priv void
setResult(ListenableFuture<? extends O> result)

Implements abstract com.google.common.util.concurrent.AbstractTransformFuture.setResult.

Template method for subtypes to actually set the result.
Inherited from com.google.common.util.concurrent.AbstractTransformFuture:
afterDonecreatecreatependingToStringrun

Constructor Detail

AsyncTransformFutureback to summary
pack-priv AsyncTransformFuture(ListenableFuture<? extends I> inputFuture, AsyncFunction<? super I, ? extends O> function)

Method Detail

doTransformback to summary
pack-priv ListenableFuture<? extends O> doTransform(AsyncFunction<? super I, ? extends O> function, I input) throws Exception

Implements abstract com.google.common.util.concurrent.AbstractTransformFuture.doTransform.

Doc from com.google.common.util.concurrent.AbstractTransformFuture.doTransform.

Template method for subtypes to actually run the transform.

Annotations
@Override
setResultback to summary
pack-priv void setResult(ListenableFuture<? extends O> result)

Implements abstract com.google.common.util.concurrent.AbstractTransformFuture.setResult.

Doc from com.google.common.util.concurrent.AbstractTransformFuture.setResult.

Template method for subtypes to actually set the result.

Annotations
@Override
com.google.common.util.concurrent back to summary

private final Class AbstractTransformFuture.TransformFuture<I extends @Nullable Object, O extends @Nullable Object>

extends AbstractTransformFuture<I extends @Nullable Object, O extends @Nullable Object, Function<? super I extends @Nullable Object, ? extends O extends @Nullable Object>, O extends @Nullable Object>
Class Inheritance

An AbstractTransformFuture that delegates to a Function and set(Object).

Field Summary

Inherited from com.google.common.util.concurrent.AbstractTransformFuture:
functioninputFuture

Constructor Summary

AccessConstructor and Description
pack-priv
TransformFuture(ListenableFuture<? extends I> inputFuture, Function<? super I, ? extends O> function)

Method Summary

Modifier and TypeMethod and Description
pack-priv O
doTransform(Function<? super I, ? extends O> function, I input)

Implements abstract com.google.common.util.concurrent.AbstractTransformFuture.doTransform.

Template method for subtypes to actually run the transform.
pack-priv void
setResult(O result)

Implements abstract com.google.common.util.concurrent.AbstractTransformFuture.setResult.

Template method for subtypes to actually set the result.
Inherited from com.google.common.util.concurrent.AbstractTransformFuture:
afterDonecreatecreatependingToStringrun

Constructor Detail

TransformFutureback to summary
pack-priv TransformFuture(ListenableFuture<? extends I> inputFuture, Function<? super I, ? extends O> function)

Method Detail

doTransformback to summary
pack-priv O doTransform(Function<? super I, ? extends O> function, I input)

Implements abstract com.google.common.util.concurrent.AbstractTransformFuture.doTransform.

Doc from com.google.common.util.concurrent.AbstractTransformFuture.doTransform.

Template method for subtypes to actually run the transform.

Annotations
@Override
@ParametricNullness
setResultback to summary
pack-priv void setResult(O result)

Implements abstract com.google.common.util.concurrent.AbstractTransformFuture.setResult.

Doc from com.google.common.util.concurrent.AbstractTransformFuture.setResult.

Template method for subtypes to actually set the result.

Annotations
@Override