Class Parameter

  • All Implemented Interfaces:
    java.lang.reflect.AnnotatedElement

    public final class Parameter
    extends java.lang.Object
    implements java.lang.reflect.AnnotatedElement
    Represents a method or constructor parameter.
    Since:
    14.0
    Author:
    Ben Yu
    • Method Detail

      • isAnnotationPresent

        public boolean isAnnotationPresent​(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
        Specified by:
        isAnnotationPresent in interface java.lang.reflect.AnnotatedElement
      • getAnnotation

        @CheckForNull
        public <A extends java.lang.annotation.Annotation> A getAnnotation​(java.lang.Class<A> annotationType)
        Specified by:
        getAnnotation in interface java.lang.reflect.AnnotatedElement
      • getAnnotations

        public java.lang.annotation.Annotation[] getAnnotations()
        Specified by:
        getAnnotations in interface java.lang.reflect.AnnotatedElement
      • getAnnotationsByType

        public <A extends java.lang.annotation.Annotation> A[] getAnnotationsByType​(java.lang.Class<A> annotationType)
        Specified by:
        getAnnotationsByType in interface java.lang.reflect.AnnotatedElement
        Since:
        18.0
      • getDeclaredAnnotations

        public java.lang.annotation.Annotation[] getDeclaredAnnotations()
        Specified by:
        getDeclaredAnnotations in interface java.lang.reflect.AnnotatedElement
        Since:
        18.0
      • getDeclaredAnnotation

        @CheckForNull
        public <A extends java.lang.annotation.Annotation> A getDeclaredAnnotation​(java.lang.Class<A> annotationType)
        Specified by:
        getDeclaredAnnotation in interface java.lang.reflect.AnnotatedElement
        Since:
        18.0
      • getDeclaredAnnotationsByType

        public <A extends java.lang.annotation.Annotation> A[] getDeclaredAnnotationsByType​(java.lang.Class<A> annotationType)
        Specified by:
        getDeclaredAnnotationsByType in interface java.lang.reflect.AnnotatedElement
        Since:
        18.0
      • getAnnotatedType

        @Beta
        @Deprecated
        public java.lang.reflect.AnnotatedType getAnnotatedType()
        Deprecated.
        This method does not work under Android VMs. It is safe to use from guava-jre, but this copy in guava-android is not safe to use.
        Returns the AnnotatedType of the parameter.

        This method will fail if run under an Android VM.

        Since:
        NEXT for guava-android (available since 25.1 in guava-jre)
      • equals

        public boolean equals​(@CheckForNull
                              java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object