Class TypePredicates

java.lang.Object
com.google.errorprone.predicates.TypePredicates

public final class TypePredicates extends Object
A collection of TypePredicates.
  • Method Details

    • nothing

      public static TypePredicate nothing()
      Matches nothing (always false).
    • anything

      public static TypePredicate anything()
      Matches everything (always true).
    • isArray

      public static TypePredicate isArray()
      Match arrays.
    • isArrayOf

      public static TypePredicate isArrayOf(TypePredicate predicate)
    • isPrimitive

      public static TypePredicate isPrimitive()
    • hasAnnotation

      public static TypePredicate hasAnnotation(String annotationType)
      Match types that are annotated with the given annotation.
    • hasAnnotation

      public static TypePredicate hasAnnotation(ClassName annotationType)
      Match types that are annotated with the given annotation.
    • isExactType

      public static TypePredicate isExactType(String type)
      Match types that are exactly equal.
    • isExactType

      public static TypePredicate isExactType(ClassName type)
      Match types that are exactly equal.
    • isExactType

      public static TypePredicate isExactType(Supplier<com.sun.tools.javac.code.Type> type)
      Match types that are exactly equal.
    • isExactTypeAny

      public static TypePredicate isExactTypeAny(Iterable<String> types)
      Match types that are exactly equal to any of the given types.
    • isExactTypeAny

      public static TypePredicate isExactTypeAny(ClassName... types)
      Match types that are exactly equal to any of the given types.
    • isExactTypeAnyOf

      public static TypePredicate isExactTypeAnyOf(Iterable<ClassName> types)
      Match types that are exactly equal to any of the given classes.
    • isDescendantOf

      public static TypePredicate isDescendantOf(Supplier<com.sun.tools.javac.code.Type> type)
      Match sub-types of the given type.
    • isDescendantOf

      public static TypePredicate isDescendantOf(String type)
      Match sub-types of the given type.
    • isDescendantOf

      public static TypePredicate isDescendantOf(ClassName type)
      Match sub-types of the given type.
    • isDescendantOfAny

      public static TypePredicate isDescendantOfAny(Iterable<String> types)
      Match types that are a sub-type of one of the given types.
    • isDescendantOfAny

      public static TypePredicate isDescendantOfAny(ClassName... types)
      Match types that are a sub-type of one of the given types.
    • isDescendantOfAny

      public static TypePredicate isDescendantOfAny(com.google.common.collect.ImmutableList<Supplier<com.sun.tools.javac.code.Type>> types)
    • isDescendantOfAnyOf

      public static TypePredicate isDescendantOfAnyOf(Iterable<ClassName> types)
      Match types that are a sub-type of one of the given classes.
    • allOf

      public static TypePredicate allOf(TypePredicate... predicates)
    • anyOf

      public static TypePredicate anyOf(TypePredicate... predicates)
    • anyOf

      public static TypePredicate anyOf(com.google.common.collect.ImmutableList<TypePredicate> predicates)
    • not

      public static TypePredicate not(TypePredicate predicate)