Class ThreadSafety.Builder
java.lang.Object
com.google.errorprone.bugpatterns.threadsafety.ThreadSafety.Builder
- Enclosing class:
ThreadSafety
ThreadSafety
Builder-
Method Summary
Modifier and TypeMethodDescriptionacceptedAnnotations
(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.build
(VisitorState state) containerOfAnnotation
(Class<? extends Annotation> containerOfAnnotation) An annotation which marks a generic parameter as a container type.containerOfAnnotation
(Iterable<String> containerOfAnnotation) An annotation which marks a generic parameter as a container type.knownTypes
(ThreadSafetyKnownTypes knownTypes) Information about known types and whether they're known to be safe or unsafe.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.setPurpose
(ThreadSafety.Purpose purpose) SeeThreadSafety.Purpose
.suppressAnnotation
(Class<? extends Annotation> suppressAnnotation) An annotation which, when found on a class, should suppress the testsuppressAnnotation
(Iterable<String> suppressAnnotation) An annotation which, when found on a class, should suppress the testtypeParameterAnnotation
(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
(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
-