Class Annotations.AnnotationChecker

  • Enclosing class:
    Annotations

    static class Annotations.AnnotationChecker
    extends java.lang.Object
    Checks for the presence of annotations. Caches results because Android doesn't.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> annotationTypes  
      (package private) com.google.common.cache.LoadingCache<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.Boolean> cache  
      private com.google.common.cache.CacheLoader<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.Boolean> hasAnnotations
      Returns true if the given class has one of the desired annotations.
    • Constructor Summary

      Constructors 
      Constructor Description
      AnnotationChecker​(java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> annotationTypes)
      Constructs a new checker that looks for annotations of the given types.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) boolean hasAnnotations​(java.lang.Class<? extends java.lang.annotation.Annotation> annotated)
      Returns true if the given type has one of the desired annotations.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • annotationTypes

        private final java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> annotationTypes
      • hasAnnotations

        private com.google.common.cache.CacheLoader<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.Boolean> hasAnnotations
        Returns true if the given class has one of the desired annotations.
      • cache

        final com.google.common.cache.LoadingCache<java.lang.Class<? extends java.lang.annotation.Annotation>,​java.lang.Boolean> cache
    • Constructor Detail

      • AnnotationChecker

        AnnotationChecker​(java.util.Collection<java.lang.Class<? extends java.lang.annotation.Annotation>> annotationTypes)
        Constructs a new checker that looks for annotations of the given types.
    • Method Detail

      • hasAnnotations

        boolean hasAnnotations​(java.lang.Class<? extends java.lang.annotation.Annotation> annotated)
        Returns true if the given type has one of the desired annotations.