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

pack-priv final Class FuturesGetChecked

extends Object
Class Inheritance
Annotations
@J2ktIncompatible
@GwtIncompatible
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkArgument, java.lang.Thread.currentThread, java.util.Arrays.asList

Static methods used to implement Futures#getChecked(Future, Class).

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static interface
pack-priv static class
FuturesGetChecked.GetCheckedTypeValidatorHolder

Provides a check of whether an exception type is valid for use with FuturesGetChecked#getChecked(Future, Class), possibly using caching.

Field Summary

Modifier and TypeField and Description
private static final Ordering<Constructor<?>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static FuturesGetChecked.GetCheckedTypeValidator
pack-priv static void
checkExceptionClassValidity(Class<? extends Exception> exceptionClass)

pack-priv static FuturesGetChecked.GetCheckedTypeValidator
pack-priv static <V extends @Nullable Object, X extends Exception> V
getChecked(Future<V> future, Class<X> exceptionClass)

pack-priv static <V extends @Nullable Object, X extends Exception> V
getChecked(FuturesGetChecked.GetCheckedTypeValidator validator, Future<V> future, Class<X> exceptionClass)

Implementation of Futures#getChecked(Future, Class).

pack-priv static <V extends @Nullable Object, X extends Exception> V
getChecked(Future<V> future, Class<X> exceptionClass, long timeout, TimeUnit unit)

Implementation of Futures#getChecked(Future, Class, long, TimeUnit).

private static boolean
pack-priv static boolean
private static <X> X
newFromConstructor(Constructor<X> constructor, Throwable cause)

private static <X extends Exception> X
newWithCause(Class<X> exceptionClass, Throwable cause)

private static <X extends Exception> List<Constructor<X>>
pack-priv static FuturesGetChecked.GetCheckedTypeValidator
private static <X extends Exception> void
wrapAndThrowExceptionOrError(Throwable cause, Class<X> exceptionClass)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

WITH_STRING_PARAM_FIRSTback to summary
private static final Ordering<Constructor<?>> WITH_STRING_PARAM_FIRST

Constructor Detail

FuturesGetCheckedback to summary
private FuturesGetChecked()

Method Detail

bestGetCheckedTypeValidatorback to summary
private static FuturesGetChecked.GetCheckedTypeValidator bestGetCheckedTypeValidator()
checkExceptionClassValidityback to summary
pack-priv static void checkExceptionClassValidity(Class<? extends Exception> exceptionClass)
Annotations
@VisibleForTesting
classValueValidatorback to summary
pack-priv static FuturesGetChecked.GetCheckedTypeValidator classValueValidator()
Annotations
@J2ObjCIncompatible
@VisibleForTesting
getCheckedback to summary
pack-priv static <V extends @Nullable Object, X extends Exception> V getChecked(Future<V> future, Class<X> exceptionClass) throws Class-:X
Annotations
@CanIgnoreReturnValue
@ParametricNullness
getCheckedback to summary
pack-priv static <V extends @Nullable Object, X extends Exception> V getChecked(FuturesGetChecked.GetCheckedTypeValidator validator, Future<V> future, Class<X> exceptionClass) throws Class-:X

Implementation of Futures#getChecked(Future, Class).

Annotations
@CanIgnoreReturnValue
@VisibleForTesting
@ParametricNullness
getCheckedback to summary
pack-priv static <V extends @Nullable Object, X extends Exception> V getChecked(Future<V> future, Class<X> exceptionClass, long timeout, TimeUnit unit) throws TimeUnit-:X

Implementation of Futures#getChecked(Future, Class, long, TimeUnit).

Annotations
@CanIgnoreReturnValue
@ParametricNullness
hasConstructorUsableByGetCheckedback to summary
private static boolean hasConstructorUsableByGetChecked(Class<? extends Exception> exceptionClass)
isCheckedExceptionback to summary
pack-priv static boolean isCheckedException(Class<? extends Exception> type)
Annotations
@VisibleForTesting
newFromConstructorback to summary
private static <X> X newFromConstructor(Constructor<X> constructor, Throwable cause)
Annotations
@CheckForNull
newWithCauseback to summary
private static <X extends Exception> X newWithCause(Class<X> exceptionClass, Throwable cause)
preferringStringsback to summary
private static <X extends Exception> List<Constructor<X>> preferringStrings(List<Constructor<X>> constructors)
weakSetValidatorback to summary
pack-priv static FuturesGetChecked.GetCheckedTypeValidator weakSetValidator()
Annotations
@VisibleForTesting
wrapAndThrowExceptionOrErrorback to summary
private static <X extends Exception> void wrapAndThrowExceptionOrError(Throwable cause, Class<X> exceptionClass) throws Class-:X
com.google.common.util.concurrent back to summary

pack-priv Interface FuturesGetChecked.GetCheckedTypeValidator

Known Direct Implementers
com.google.common.util.concurrent.FuturesGetChecked.GetCheckedTypeValidatorHolder.ClassValueValidator, com.google.common.util.concurrent.FuturesGetChecked.GetCheckedTypeValidatorHolder.WeakSetValidator
Annotations
@VisibleForTesting

Method Summary

Modifier and TypeMethod and Description
public void
validateClass(Class<? extends Exception> exceptionClass)

Method Detail

validateClassback to summary
public void validateClass(Class<? extends Exception> exceptionClass)
com.google.common.util.concurrent back to summary

pack-priv Class FuturesGetChecked.GetCheckedTypeValidatorHolder

extends Object
Class Inheritance
  • java.lang.Object
  • com.google.common.util.concurrent.FuturesGetChecked.GetCheckedTypeValidatorHolder
Annotations
@VisibleForTesting

Provides a check of whether an exception type is valid for use with FuturesGetChecked#getChecked(Future, Class), possibly using caching.

Uses reflection to gracefully fall back to when certain implementations aren't available.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static enum
pack-priv static enum

Field Summary

Modifier and TypeField and Description
pack-priv static final FuturesGetChecked.GetCheckedTypeValidator
pack-priv static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static FuturesGetChecked.GetCheckedTypeValidator
getBestValidator()

Returns the ClassValue-using validator, or falls back to the "weak Set" implementation if unable to do so.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BEST_VALIDATORback to summary
pack-priv static final FuturesGetChecked.GetCheckedTypeValidator BEST_VALIDATOR
CLASS_VALUE_VALIDATOR_NAMEback to summary
pack-priv static final String CLASS_VALUE_VALIDATOR_NAME

Constructor Detail

GetCheckedTypeValidatorHolderback to summary
pack-priv GetCheckedTypeValidatorHolder()

Method Detail

getBestValidatorback to summary
pack-priv static FuturesGetChecked.GetCheckedTypeValidator getBestValidator()

Returns the ClassValue-using validator, or falls back to the "weak Set" implementation if unable to do so.

com.google.common.util.concurrent back to summary

pack-priv final Enum FuturesGetChecked.GetCheckedTypeValidatorHolder.ClassValueValidator

extends Enum<FuturesGetChecked.GetCheckedTypeValidatorHolder.ClassValueValidator>
implements GetCheckedTypeValidator
Class Inheritance
All Implemented Interfaces
com.google.common.util.concurrent.FuturesGetChecked.GetCheckedTypeValidator
Annotations
@J2ObjCIncompatible

Field Summary

Modifier and TypeField and Description
public static final FuturesGetChecked.GetCheckedTypeValidatorHolder.ClassValueValidator
private static final ClassValue<Boolean>

Constructor Summary

AccessConstructor and Description
private

Field Detail

INSTANCEback to summary
public static final FuturesGetChecked.GetCheckedTypeValidatorHolder.ClassValueValidator INSTANCE
isValidClassback to summary
private static final ClassValue<Boolean> isValidClass

Constructor Detail

ClassValueValidatorback to summary
private ClassValueValidator()
com.google.common.util.concurrent back to summary

pack-priv final Enum FuturesGetChecked.GetCheckedTypeValidatorHolder.WeakSetValidator

extends Enum<FuturesGetChecked.GetCheckedTypeValidatorHolder.WeakSetValidator>
implements GetCheckedTypeValidator
Class Inheritance
All Implemented Interfaces
com.google.common.util.concurrent.FuturesGetChecked.GetCheckedTypeValidator

Field Summary

Modifier and TypeField and Description
public static final FuturesGetChecked.GetCheckedTypeValidatorHolder.WeakSetValidator
private static final Set<WeakReference<Class<? extends Exception>>>

Constructor Summary

AccessConstructor and Description
private

Field Detail

INSTANCEback to summary
public static final FuturesGetChecked.GetCheckedTypeValidatorHolder.WeakSetValidator INSTANCE
validClassesback to summary
private static final Set<WeakReference<Class<? extends Exception>>> validClasses

Constructor Detail

WeakSetValidatorback to summary
private WeakSetValidator()