Class AnnotatedMethod

    • Method Detail

      • method

        public Method method()
        Get the underlying Java method.

        This will be the method that is actually annotated with GrpcMethod, which may be the same as or overridden by the method returned by declaredMethod().

        Returns:
        the actual annotated Java method.
      • declaredMethod

        public Method declaredMethod()
        Get the declared Java method.

        This method overrides, or is the same as, the one retrieved by method().

        Returns:
        the declared Java method.
      • parameterAnnotations

        public Annotation[][] parameterAnnotations()
        Get method parameter annotations.
        Returns:
        method parameter annotations.
      • genericReturnType

        public Type genericReturnType()
        Get generic method return type. See also Method.getGenericReturnType() ()}.
        Returns:
        generic method return types.
      • returnType

        public Class<?> returnType()
        Get method return type. See also Method.getReturnType() ()} ()}.
        Returns:
        method return types.
      • metaMethodAnnotations

        public <T extends AnnotationStream<T> metaMethodAnnotations​(Class<T> annotation)
        Get all instances of the specified meta-annotation type found on the method annotations (a meta-annotation is an annotation that annotates other annotations).
        Type Parameters:
        T - meta-annotation type.
        Parameters:
        annotation - meta-annotation class to be searched for.
        Returns:
        meta-annotation instances of a given type annotating the method annotations.
      • firstAnnotationOrMetaAnnotation

        public <T extends Annotation> T firstAnnotationOrMetaAnnotation​(Class<T> type)
        Get the first of the specified meta-annotation type found on the method annotations or on the method itself (a meta-annotation is an annotation that annotates other annotations).
        Type Parameters:
        T - meta-annotation type.
        Parameters:
        type - meta-annotation class to be searched for.
        Returns:
        meta-annotation instances of a given type annotating the method annotations
      • annotationOrMetaAnnotation

        public <T extends AnnotationStream<T> annotationOrMetaAnnotation​(Class<T> type)
        Get all instances of the specified meta-annotation type found on the method annotations or on the method itself (a meta-annotation is an annotation that annotates other annotations).
        Type Parameters:
        T - meta-annotation type.
        Parameters:
        type - meta-annotation class to be searched for.
        Returns:
        meta-annotation instances of a given type annotating the method annotations
      • annotationsWithMetaAnnotation

        public Stream<Annotation> annotationsWithMetaAnnotation​(Class<? extends Annotation> type)
        Get all instances of annotations annotated with the specified meta-annotation.
        Parameters:
        type - meta-annotation class to be searched for.
        Returns:
        all instances of annotations annotated with the specified meta-annotation