Class ThreadSafety.Builder

java.lang.Object
com.google.errorprone.bugpatterns.threadsafety.ThreadSafety.Builder
Enclosing class:
ThreadSafety

public static class ThreadSafety.Builder
extends Object
  • Method Details

    • setPurpose

      public ThreadSafety.Builder setPurpose​(ThreadSafety.Purpose purpose)
    • knownTypes

      public ThreadSafety.Builder knownTypes​(ThreadSafety.KnownTypes knownTypes)
      Information about known types and whether they're known to be safe or unsafe.
    • markerAnnotations

      public ThreadSafety.Builder markerAnnotations​(Set<String> markerAnnotations)
      Annotations that will cause a class to be tested with this ThreadSafety instance; for example, when testing a class for immutability, this should be @Immutable.
    • markerAnnotations

      public ThreadSafety.Builder markerAnnotations​(com.google.common.collect.ImmutableSet<String> markerAnnotations)
    • acceptedAnnotations

      public ThreadSafety.Builder acceptedAnnotations​(Set<String> acceptedAnnotations)
      Annotations that do *not* cause a class to be tested, but which are treated as valid annotations to pass the test; for example, if @ThreadSafe is the marker annotation, @Immutable would be included in this list, as an immutable class is by definition thread-safe.
    • acceptedAnnotations

      public ThreadSafety.Builder acceptedAnnotations​(com.google.common.collect.ImmutableSet<String> acceptedAnnotations)
    • containerOfAnnotation

      public ThreadSafety.Builder containerOfAnnotation​(Class<? extends Annotation> containerOfAnnotation)
      An annotation which marks a generic parameter as a container type.
    • suppressAnnotation

      public ThreadSafety.Builder suppressAnnotation​(Class<? extends Annotation> suppressAnnotation)
      An annotation which, when found on a class, should suppress the test
    • typeParameterAnnotation

      public ThreadSafety.Builder typeParameterAnnotation​(Class<? extends Annotation> typeParameterAnnotation)
      An annotation which, when found on a type parameter, indicates that the type parameter may only be instantiated with thread-safe types.
    • build

      public ThreadSafety build​(VisitorState state)