Enum SupportedAnnotations
java.lang.Object
java.lang.Enum<SupportedAnnotations>
nl.jqno.equalsverifier.internal.reflection.annotations.SupportedAnnotations
- All Implemented Interfaces:
Serializable
,Comparable<SupportedAnnotations>
,Annotation
Descriptions of the annotations that EqualsVerifier supports.
The actual annotations cannot be referenced here, as that would create dependencies on the libraries that contain them, and it would preclude people from creating and using their own annotations with the same name.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIf a class or package is marked with @NonNullByDefault, EqualsVerifier will not complain about potentialNullPointerException
s being thrown if any of the fields in that class or package are null.JPA Entities cannot be final, nor can their fields be.If a class or package is marked with @DefaultAnnotation(Nonnull.class), EqualsVerifier will not complain about potentialNullPointerException
s being thrown if any of the fields in that class or package are null.Fields in JPA Entities that are marked @Id or @EmbeddedId are usually part of the entity's surrogate key.If a class is marked @Immutable, EqualsVerifier will not complain about fields not being final.Represents any annotation that is marked with @Nonnull and @TypeQualifierDefault.If an annotation type is marked with JSR305's @TypeQualifierDefault annotation, it becomes a 'default' annotation for whatever other annotation it is marked with; for example @Nonnull.Fields in JPA Entities that are marked @NaturalId are part of the entity's natural/business identity.If a field is marked @Nonnull (or @NonNull or @NotNull), EqualsVerifier will not complain about potentialNullPointerException
s being thrown if this field is null.If a class is marked @Nonnull, @Nullable can be used to revert that for specific fields.Fields in JPA Entities that are marked @Transient should not be included in the equals/hashCode contract, like fields that have the Java transient modifier. -
Method Summary
Modifier and TypeMethodDescriptionboolean
inherits()
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.static SupportedAnnotations
Returns the enum constant of this type with the specified name.static SupportedAnnotations[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface nl.jqno.equalsverifier.internal.reflection.annotations.Annotation
postProcess, validate
-
Enum Constant Details
-
IMMUTABLE
If a class is marked @Immutable, EqualsVerifier will not complain about fields not being final. -
NONNULL
If a field is marked @Nonnull (or @NonNull or @NotNull), EqualsVerifier will not complain about potentialNullPointerException
s being thrown if this field is null. -
NULLABLE
If a class is marked @Nonnull, @Nullable can be used to revert that for specific fields. -
FINDBUGS1X_DEFAULT_ANNOTATION_NONNULL
If a class or package is marked with @DefaultAnnotation(Nonnull.class), EqualsVerifier will not complain about potentialNullPointerException
s being thrown if any of the fields in that class or package are null.Note that @DefaultAnnotation is deprecated. Nevertheless, EqualsVerifier still supports it.
-
JSR305_DEFAULT_ANNOTATION_NONNULL
Represents any annotation that is marked with @Nonnull and @TypeQualifierDefault. If a class or package is marked with such an annotation, EqualsVerifier will not complain about potentialNullPointerException
s being thrown if any of the fields in that class or package are null. -
JSR305_TYPE_QUALIFIER_DEFAULT
If an annotation type is marked with JSR305's @TypeQualifierDefault annotation, it becomes a 'default' annotation for whatever other annotation it is marked with; for example @Nonnull. -
ECLIPSE_DEFAULT_ANNOTATION_NONNULL
If a class or package is marked with @NonNullByDefault, EqualsVerifier will not complain about potentialNullPointerException
s being thrown if any of the fields in that class or package are null. -
ENTITY
JPA Entities cannot be final, nor can their fields be. EqualsVerifier will not complain about non-final fields on @Entity, @Embeddable and @MappedSuperclass classes. -
TRANSIENT
Fields in JPA Entities that are marked @Transient should not be included in the equals/hashCode contract, like fields that have the Java transient modifier. EqualsVerifier will treat these the same. -
ID
Fields in JPA Entities that are marked @Id or @EmbeddedId are usually part of the entity's surrogate key. EqualsVerifier will therefore assume that it must not be used in the equals/hashCode contract, unlessWarning.SURROGATE_KEY
is suppressed. -
NATURALID
Fields in JPA Entities that are marked @NaturalId are part of the entity's natural/business identity. If a @NaturalId annotation is present in an entity, all fields marked with this annotation must be part of the equals/hashCode contract, and all fields NOT marked with it must NOT be part of the contract. -
LAZY_FIELD
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
partialClassNames
Description copied from interface:Annotation
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.- Specified by:
partialClassNames
in interfaceAnnotation
- Returns:
- A Set of potentially partial annotation class names.
-
inherits
public boolean inherits()Description copied from interface:Annotation
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.- Specified by:
inherits
in interfaceAnnotation
- Returns:
- True if the annotation is inherited by subclasses of the class in which the annotation appears.
-