All Known Implementing Classes:
SupportedAnnotations

public interface Annotation
Describes an annotation that can be recognised by EqualsVerifier.

The annotation can have RetentionPolicy.RUNTIME or RetentionPolicy.CLASS, and must have either ElementType.TYPE or ElementType.FIELD.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Whether the annotation applies to the class in which is appears only, or whether it applies to that class and all its subclasses.
    One or more strings that contain the annotation's (partial) class name.
    default void
    postProcess(Set<Class<?>> types, AnnotationCache annotationCache)
    Performs post processing after the annotation was added to the cache.
    default boolean
    validate(AnnotationProperties properties, AnnotationCache annotationCache, Set<String> ignoredAnnotations)
    Validates the annotation based on its properties.
  • Method Details

    • partialClassNames

      Set<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 one Annotation 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 than Inherited 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, Set<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(Set<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.