Class FuturesGetChecked
- java.lang.Object
-
- com.google.common.util.concurrent.FuturesGetChecked
-
@GwtIncompatible final class FuturesGetChecked extends java.lang.Object
Static methods used to implementFutures.getChecked(Future, Class).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfaceFuturesGetChecked.GetCheckedTypeValidator(package private) static classFuturesGetChecked.GetCheckedTypeValidatorHolderProvides a check of whether an exception type is valid for use withgetChecked(Future, Class), possibly using caching.
-
Field Summary
Fields Modifier and Type Field Description private static Ordering<java.lang.reflect.Constructor<?>>WITH_STRING_PARAM_FIRST
-
Constructor Summary
Constructors Modifier Constructor Description privateFuturesGetChecked()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static FuturesGetChecked.GetCheckedTypeValidatorbestGetCheckedTypeValidator()(package private) static voidcheckExceptionClassValidity(java.lang.Class<? extends java.lang.Exception> exceptionClass)(package private) static FuturesGetChecked.GetCheckedTypeValidatorclassValueValidator()(package private) static <V,X extends java.lang.Exception>
VgetChecked(FuturesGetChecked.GetCheckedTypeValidator validator, java.util.concurrent.Future<V> future, java.lang.Class<X> exceptionClass)Implementation ofFutures.getChecked(Future, Class).(package private) static <V,X extends java.lang.Exception>
VgetChecked(java.util.concurrent.Future<V> future, java.lang.Class<X> exceptionClass)(package private) static <V,X extends java.lang.Exception>
VgetChecked(java.util.concurrent.Future<V> future, java.lang.Class<X> exceptionClass, long timeout, java.util.concurrent.TimeUnit unit)Implementation ofFutures.getChecked(Future, Class, long, TimeUnit).private static booleanhasConstructorUsableByGetChecked(java.lang.Class<? extends java.lang.Exception> exceptionClass)(package private) static booleanisCheckedException(java.lang.Class<? extends java.lang.Exception> type)private static <X> XnewFromConstructor(java.lang.reflect.Constructor<X> constructor, java.lang.Throwable cause)private static <X extends java.lang.Exception>
XnewWithCause(java.lang.Class<X> exceptionClass, java.lang.Throwable cause)private static <X extends java.lang.Exception>
java.util.List<java.lang.reflect.Constructor<X>>preferringStrings(java.util.List<java.lang.reflect.Constructor<X>> constructors)(package private) static FuturesGetChecked.GetCheckedTypeValidatorweakSetValidator()private static <X extends java.lang.Exception>
voidwrapAndThrowExceptionOrError(java.lang.Throwable cause, java.lang.Class<X> exceptionClass)
-
-
-
Field Detail
-
WITH_STRING_PARAM_FIRST
private static final Ordering<java.lang.reflect.Constructor<?>> WITH_STRING_PARAM_FIRST
-
-
Method Detail
-
getChecked
static <V,X extends java.lang.Exception> V getChecked(java.util.concurrent.Future<V> future, java.lang.Class<X> exceptionClass) throws X extends java.lang.Exception- Throws:
X extends java.lang.Exception
-
getChecked
static <V,X extends java.lang.Exception> V getChecked(FuturesGetChecked.GetCheckedTypeValidator validator, java.util.concurrent.Future<V> future, java.lang.Class<X> exceptionClass) throws X extends java.lang.Exception
Implementation ofFutures.getChecked(Future, Class).- Throws:
X extends java.lang.Exception
-
getChecked
static <V,X extends java.lang.Exception> V getChecked(java.util.concurrent.Future<V> future, java.lang.Class<X> exceptionClass, long timeout, java.util.concurrent.TimeUnit unit) throws X extends java.lang.ExceptionImplementation ofFutures.getChecked(Future, Class, long, TimeUnit).- Throws:
X extends java.lang.Exception
-
bestGetCheckedTypeValidator
private static FuturesGetChecked.GetCheckedTypeValidator bestGetCheckedTypeValidator()
-
weakSetValidator
static FuturesGetChecked.GetCheckedTypeValidator weakSetValidator()
-
classValueValidator
static FuturesGetChecked.GetCheckedTypeValidator classValueValidator()
-
wrapAndThrowExceptionOrError
private static <X extends java.lang.Exception> void wrapAndThrowExceptionOrError(java.lang.Throwable cause, java.lang.Class<X> exceptionClass) throws X extends java.lang.Exception- Throws:
X extends java.lang.Exception
-
hasConstructorUsableByGetChecked
private static boolean hasConstructorUsableByGetChecked(java.lang.Class<? extends java.lang.Exception> exceptionClass)
-
newWithCause
private static <X extends java.lang.Exception> X newWithCause(java.lang.Class<X> exceptionClass, java.lang.Throwable cause)
-
preferringStrings
private static <X extends java.lang.Exception> java.util.List<java.lang.reflect.Constructor<X>> preferringStrings(java.util.List<java.lang.reflect.Constructor<X>> constructors)
-
newFromConstructor
private static <X> X newFromConstructor(java.lang.reflect.Constructor<X> constructor, java.lang.Throwable cause)
-
isCheckedException
static boolean isCheckedException(java.lang.Class<? extends java.lang.Exception> type)
-
checkExceptionClassValidity
static void checkExceptionClassValidity(java.lang.Class<? extends java.lang.Exception> exceptionClass)
-
-