Class ThreadSafety.Builder
java.lang.Object
com.google.errorprone.bugpatterns.threadsafety.ThreadSafety.Builder
- Enclosing class:
- ThreadSafety
public static class ThreadSafety.Builder extends Object
ThreadSafety
Builder-
Method Summary
Modifier and Type Method Description ThreadSafety.Builder
acceptedAnnotations(Iterable<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.ThreadSafety
build(VisitorState state)
ThreadSafety.Builder
containerOfAnnotation(Class<? extends Annotation> containerOfAnnotation)
An annotation which marks a generic parameter as a container type.ThreadSafety.Builder
containerOfAnnotation(Iterable<String> containerOfAnnotation)
An annotation which marks a generic parameter as a container type.ThreadSafety.Builder
knownTypes(ThreadSafety.KnownTypes knownTypes)
Information about known types and whether they're known to be safe or unsafe.ThreadSafety.Builder
markerAnnotations(Iterable<String> markerAnnotations)
Annotations that will cause a class to be tested with thisThreadSafety
instance; for example, when testing a class for immutability, this should be @Immutable.ThreadSafety.Builder
setPurpose(ThreadSafety.Purpose purpose)
SeeThreadSafety.Purpose
.ThreadSafety.Builder
suppressAnnotation(Class<? extends Annotation> suppressAnnotation)
An annotation which, when found on a class, should suppress the testThreadSafety.Builder
suppressAnnotation(Iterable<String> suppressAnnotation)
An annotation which, when found on a class, should suppress the testThreadSafety.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.ThreadSafety.Builder
typeParameterAnnotation(Iterable<String> typeParameterAnnotation)
An annotation which, when found on a type parameter, indicates that the type parameter may only be instantiated with thread-safe types.
-
Method Details
-
setPurpose
SeeThreadSafety.Purpose
. -
knownTypes
Information about known types and whether they're known to be safe or unsafe. -
markerAnnotations
@CanIgnoreReturnValue public ThreadSafety.Builder markerAnnotations(Iterable<String> markerAnnotations)Annotations that will cause a class to be tested with thisThreadSafety
instance; for example, when testing a class for immutability, this should be @Immutable. -
acceptedAnnotations
@CanIgnoreReturnValue public ThreadSafety.Builder acceptedAnnotations(Iterable<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. -
containerOfAnnotation
@CanIgnoreReturnValue public ThreadSafety.Builder containerOfAnnotation(Class<? extends Annotation> containerOfAnnotation)An annotation which marks a generic parameter as a container type. -
containerOfAnnotation
@CanIgnoreReturnValue public ThreadSafety.Builder containerOfAnnotation(Iterable<String> containerOfAnnotation)An annotation which marks a generic parameter as a container type. -
suppressAnnotation
@CanIgnoreReturnValue public ThreadSafety.Builder suppressAnnotation(Class<? extends Annotation> suppressAnnotation)An annotation which, when found on a class, should suppress the test -
suppressAnnotation
@CanIgnoreReturnValue public ThreadSafety.Builder suppressAnnotation(Iterable<String> suppressAnnotation)An annotation which, when found on a class, should suppress the test -
typeParameterAnnotation
@CanIgnoreReturnValue 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. -
typeParameterAnnotation
@CanIgnoreReturnValue public ThreadSafety.Builder typeParameterAnnotation(Iterable<String> typeParameterAnnotation)An annotation which, when found on a type parameter, indicates that the type parameter may only be instantiated with thread-safe types. -
build
-