Package org.apache.beam.sdk.util
Class MoreFutures.ExceptionOrResult<T>
- java.lang.Object
-
- org.apache.beam.sdk.util.MoreFutures.ExceptionOrResult<T>
-
- Enclosing class:
- MoreFutures
public abstract static class MoreFutures.ExceptionOrResult<T> extends java.lang.Object
An object that represents either a result or an exceptional termination.This is used, for example, in aggregating the results of many future values in
MoreFutures.allAsList(Collection)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MoreFutures.ExceptionOrResult.IsException
Describes whether the result was an exception.
-
Constructor Summary
Constructors Constructor Description ExceptionOrResult()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static <T> MoreFutures.ExceptionOrResult<T>
exception(java.lang.Throwable throwable)
abstract @Nullable java.lang.Throwable
getException()
abstract @Nullable T
getResult()
abstract MoreFutures.ExceptionOrResult.IsException
isException()
static <T> MoreFutures.ExceptionOrResult<T>
result(T result)
-
-
-
Method Detail
-
isException
public abstract MoreFutures.ExceptionOrResult.IsException isException()
-
getResult
public abstract @Nullable T getResult()
-
getException
public abstract @Nullable java.lang.Throwable getException()
-
exception
public static <T> MoreFutures.ExceptionOrResult<T> exception(java.lang.Throwable throwable)
-
result
public static <T> MoreFutures.ExceptionOrResult<T> result(T result)
-
-