Class AnnotationExtractor

java.lang.Object
io.github.resilience4j.utils.AnnotationExtractor

public class AnnotationExtractor
extends java.lang.Object
  • Method Summary

    Modifier and Type Method Description
    static <T extends java.lang.annotation.Annotation>
    T
    extract​(java.lang.Class<?> targetClass, java.lang.Class<T> annotationClass)
    extract annotation from target class
    static <T extends java.lang.annotation.Annotation>
    T
    extractAnnotationFromProxy​(java.lang.Object targetProxy, java.lang.Class<T> annotationClass)
    Extracts the annotation from the target implementation of the Proxy(ies)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • extract

      @Nullable public static <T extends java.lang.annotation.Annotation> T extract​(java.lang.Class<?> targetClass, java.lang.Class<T> annotationClass)
      extract annotation from target class
      Type Parameters:
      T - The annotation type.
      Parameters:
      targetClass - target class
      annotationClass - annotation class
      Returns:
      annotation
    • extractAnnotationFromProxy

      @Nullable public static <T extends java.lang.annotation.Annotation> T extractAnnotationFromProxy​(java.lang.Object targetProxy, java.lang.Class<T> annotationClass)
      Extracts the annotation from the target implementation of the Proxy(ies)
      Type Parameters:
      T -
      Parameters:
      targetProxy - The proxy class
      annotationClass - The annotation to extract
      Returns: