Interface Annotation
-
- All Known Implementing Classes:
SupportedAnnotations
public interface Annotation
Describes an annotation that can be recognised by EqualsVerifier. The annotation can haveRetentionPolicy.RUNTIME
orRetentionPolicy.CLASS
, and must have eitherElementType.TYPE
orElementType.FIELD
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description boolean
inherits()
Whether the annotation applies to the class in which is appears only, or whether it applies to that class and all its subclasses.java.util.Set<java.lang.String>
partialClassNames()
One or more strings that contain the annotation's (partial) class name.default void
postProcess(java.util.Set<java.lang.Class<?>> types, AnnotationCache annotationCache)
Performs post processing after the annotation was added to the cache.default boolean
validate(AnnotationProperties properties, AnnotationCache annotationCache, java.util.Set<java.lang.String> ignoredAnnotations)
Validates the annotation based on its properties.
-
-
-
Method Detail
-
partialClassNames
java.util.Set<java.lang.String> partialClassNames()
One or more strings that contain the annotation's (partial) class name. This can be the annotation's fully qualified canonical name, or a substring thereof. An annotation can be described by more than one partial class name. For instance, @Nonnull, @NonNull and @NotNull have the same semantics; their partialClassNames can be grouped together in oneAnnotation
instance.- Returns:
- A Set of potentially partial annotation class names.
-
inherits
boolean inherits()
Whether the annotation applies to the class in which is appears only, or whether it applies to that class and all its subclasses. Note: this encompasses more thanInherited
does: this flag also applies, for example, to annotations on fields that are declared in a superclass.- Returns:
- True if the annotation is inherited by subclasses of the class in which the annotation appears.
-
validate
default boolean validate(AnnotationProperties properties, AnnotationCache annotationCache, java.util.Set<java.lang.String> ignoredAnnotations)
Validates the annotation based on its properties.- Parameters:
properties
- An object that contains information about the annotation.annotationCache
- A cache containing all annotations for known types.ignoredAnnotations
- A collection of type partialClassNames for annotations to ignore.- Returns:
- True if the annotation is valid and can be used as intended.
-
postProcess
default void postProcess(java.util.Set<java.lang.Class<?>> types, AnnotationCache annotationCache)
Performs post processing after the annotation was added to the cache.- Parameters:
types
- The types that the annotation applies to.annotationCache
- A cache containing all annotations for known types.
-
-