Class FeatureUtil


  • @GwtIncompatible
    public final class FeatureUtil
    extends java.lang.Object
    Utilities for collecting and validating tester requirements from annotations.
    Author:
    George van den Driessche
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static java.util.Set<Feature<?>> addImpliedFeatures​(java.util.Set<Feature<?>> features)
      Given a set of features, add to it all the features directly or indirectly implied by any of them, and return it.
      static TesterRequirements buildDeclaredTesterRequirements​(java.lang.reflect.AnnotatedElement classOrMethod)
      Construct the set of requirements specified by annotations directly on a tester class or method.
      static java.lang.Iterable<java.lang.annotation.Annotation> getTesterAnnotations​(java.lang.reflect.AnnotatedElement classOrMethod)
      Find all the tester annotations declared on a tester class or method.
      static TesterRequirements getTesterRequirements​(java.lang.Class<?> testerClass)
      Get the full set of requirements for a tester class.
      static TesterRequirements getTesterRequirements​(java.lang.reflect.Method testerMethod)
      Get the full set of requirements for a tester class.
      static java.util.Set<Feature<?>> impliedFeatures​(java.util.Set<Feature<?>> features)
      Given a set of features, return a new set of all features directly or indirectly implied by any of them.
      static <T> java.util.Set<T> intersection​(java.util.Set<? extends T> set1, java.util.Set<? extends T> set2)
      Deprecated.
      Use Sets.intersection(Set, Set) instead.
      • Methods inherited from class java.lang.Object

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

      • addImpliedFeatures

        @CanIgnoreReturnValue
        public static java.util.Set<Feature<?>> addImpliedFeatures​(java.util.Set<Feature<?>> features)
        Given a set of features, add to it all the features directly or indirectly implied by any of them, and return it.
        Parameters:
        features - the set of features to expand
        Returns:
        the same set of features, expanded with all implied features
      • impliedFeatures

        public static java.util.Set<Feature<?>> impliedFeatures​(java.util.Set<Feature<?>> features)
        Given a set of features, return a new set of all features directly or indirectly implied by any of them.
        Parameters:
        features - the set of features whose implications to find
        Returns:
        the implied set of features
      • getTesterAnnotations

        public static java.lang.Iterable<java.lang.annotation.Annotation> getTesterAnnotations​(java.lang.reflect.AnnotatedElement classOrMethod)
        Find all the tester annotations declared on a tester class or method.
        Parameters:
        classOrMethod - a class or method whose tester annotations to find
        Returns:
        an iterable sequence of tester annotations on the class
      • intersection

        @Deprecated
        public static <T> java.util.Set<T> intersection​(java.util.Set<? extends T> set1,
                                                        java.util.Set<? extends T> set2)
        Deprecated.
        Use Sets.intersection(Set, Set) instead.
        Construct a new Set that is the intersection of the given sets.