Package com.google.common.reflect
Class Parameter
java.lang.Object
com.google.common.reflect.Parameter
- All Implemented Interfaces:
AnnotatedElement
Represents a method or constructor parameter.
- Since:
- 14.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Object
AnAnnotatedType
instance, ornull
under Android VMs (possible only when using the Android flavor of Guava).private final ImmutableList
<Annotation> private final Invokable
<?, ?> private final int
private final TypeToken
<?> -
Constructor Summary
ConstructorsConstructorDescriptionParameter
(Invokable<?, ?> declaration, int position, TypeToken<?> type, Annotation[] annotations, Object annotatedType) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns theAnnotatedType
of the parameter.<A extends Annotation>
AgetAnnotation
(Class<A> annotationType) <A extends Annotation>
A[]getAnnotationsByType
(Class<A> annotationType) <A extends Annotation>
AgetDeclaredAnnotation
(Class<A> annotationType) <A extends Annotation>
A[]getDeclaredAnnotationsByType
(Class<A> annotationType) Invokable
<?, ?> Returns theInvokable
that declares this parameter.TypeToken
<?> getType()
Returns the type of the parameter.int
hashCode()
boolean
isAnnotationPresent
(Class<? extends Annotation> annotationType) toString()
-
Field Details
-
declaration
-
position
private final int position -
type
-
annotations
-
annotatedType
AnAnnotatedType
instance, ornull
under Android VMs (possible only when using the Android flavor of Guava). The field is declared with a type ofObject
to avoid compatibility problems on Android VMs. The corresponding accessor method, however, can have the more specific return type as long as users are careful to guard calls to it with version checks or reflection: Android VMs ignore the types of elements that aren't used.
-
-
Constructor Details
-
Parameter
Parameter(Invokable<?, ?> declaration, int position, TypeToken<?> type, Annotation[] annotations, Object annotatedType)
-
-
Method Details
-
getType
Returns the type of the parameter. -
getDeclaringInvokable
Returns theInvokable
that declares this parameter. -
isAnnotationPresent
- Specified by:
isAnnotationPresent
in interfaceAnnotatedElement
-
getAnnotation
- Specified by:
getAnnotation
in interfaceAnnotatedElement
-
getAnnotations
- Specified by:
getAnnotations
in interfaceAnnotatedElement
-
getAnnotationsByType
- Specified by:
getAnnotationsByType
in interfaceAnnotatedElement
- Since:
- 18.0
-
getDeclaredAnnotations
- Specified by:
getDeclaredAnnotations
in interfaceAnnotatedElement
- Since:
- 18.0
-
getDeclaredAnnotation
- Specified by:
getDeclaredAnnotation
in interfaceAnnotatedElement
- Since:
- 18.0
-
getDeclaredAnnotationsByType
- Specified by:
getDeclaredAnnotationsByType
in interfaceAnnotatedElement
- Since:
- 18.0
-
getAnnotatedType
Returns theAnnotatedType
of the parameter.- Since:
- 25.1 for guava-jre
-
equals
-
hashCode
public int hashCode() -
toString
-