Package | Description |
---|---|
com.google.common.reflect |
This package contains utilities to work with Java reflection.
|
com.google.common.testing |
This package contains testing utilities.
|
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Invokable.ConstructorInvokable<T> |
(package private) static class |
Invokable.MethodInvokable<T> |
Modifier and Type | Field and Description |
---|---|
private Invokable<?,?> |
Parameter.declaration |
Modifier and Type | Method and Description |
---|---|
Invokable<T,T> |
TypeToken.constructor(java.lang.reflect.Constructor<?> constructor)
|
static <T> Invokable<T,T> |
Invokable.from(java.lang.reflect.Constructor<T> constructor)
Returns
Invokable of constructor . |
static Invokable<?,java.lang.Object> |
Invokable.from(java.lang.reflect.Method method)
Returns
Invokable of method . |
Invokable<?,?> |
Parameter.getDeclaringInvokable()
Returns the
Invokable that declares this parameter. |
Invokable<T,java.lang.Object> |
TypeToken.method(java.lang.reflect.Method method)
|
<R1 extends R> |
Invokable.returning(java.lang.Class<R1> returnType)
Explicitly specifies the return type of this
Invokable . |
<R1 extends R> |
Invokable.returning(TypeToken<R1> returnType)
Explicitly specifies the return type of this
Invokable . |
Constructor and Description |
---|
Parameter(Invokable<?,?> declaration,
int position,
TypeToken<?> type,
java.lang.annotation.Annotation[] annotations,
java.lang.reflect.AnnotatedType annotatedType) |
Modifier and Type | Field and Description |
---|---|
private static Ordering<Invokable<?,?>> |
ClassSanityTester.BY_METHOD_NAME |
private static Ordering<Invokable<?,?>> |
ClassSanityTester.BY_NUMBER_OF_PARAMETERS |
private static Ordering<Invokable<?,?>> |
ClassSanityTester.BY_PARAMETERS |
private ImmutableList<Invokable<?,?>> |
ClassSanityTester.FactoryMethodReturnValueTester.factories |
Modifier and Type | Method and Description |
---|---|
private static Invokable<?,?> |
NullPointerTester.invokable(java.lang.Object instance,
java.lang.reflect.Method method) |
Modifier and Type | Method and Description |
---|---|
private static <T> ImmutableList<Invokable<?,? extends T>> |
ClassSanityTester.getFactories(TypeToken<T> type)
Factories with the least number of parameters are listed first.
|
private ImmutableList<Invokable<?,?>> |
ClassSanityTester.FactoryMethodReturnValueTester.getFactoriesToTest() |
Modifier and Type | Method and Description |
---|---|
private java.lang.Object[] |
NullPointerTester.buildParamList(Invokable<?,?> invokable,
int indexOfParamToSetToNull) |
private static <T> T |
ClassSanityTester.createInstance(Invokable<?,? extends T> factory,
java.util.List<?> args) |
private java.util.List<java.lang.Object> |
ClassSanityTester.generateEqualFactoryArguments(Invokable<?,?> factory,
java.util.List<Parameter> params,
java.util.List<java.lang.Object> args)
Returns dummy factory arguments that are equal to
args but may be different instances,
to be used to construct a second instance of the same equality group. |
private java.util.List<java.lang.Object> |
ClassSanityTester.getDummyArguments(Invokable<?,?> invokable) |
private static boolean |
ClassSanityTester.hashCodeInsensitiveToArgReference(Invokable<?,?> factory,
java.util.List<java.lang.Object> args,
int i,
java.lang.Object alternateArg) |
private <T> T |
ClassSanityTester.instantiate(Invokable<?,? extends T> factory)
Instantiates using
factory . |
private static <T> T |
ClassSanityTester.invoke(Invokable<?,? extends T> factory,
java.util.List<?> args) |
(package private) static boolean |
NullPointerTester.isNullable(Invokable<?,?> invokable) |
private void |
ClassSanityTester.testEqualsUsing(Invokable<?,?> factory) |
private void |
NullPointerTester.testParameter(java.lang.Object instance,
Invokable<?,?> invokable,
int paramIndex,
java.lang.Class<?> testedClass)
Verifies that
invokable produces a NullPointerException or UnsupportedOperationException when the parameter in position paramIndex is null. |
Constructor and Description |
---|
FactoryMethodReturnsNullException(Invokable<?,?> factory) |
Constructor and Description |
---|
FactoryMethodReturnValueTester(java.lang.Class<?> declaringClass,
ImmutableList<Invokable<?,?>> factories,
java.lang.String factoryMethodsDescription) |