@Target(value=TYPE)
@Retention(value=SOURCE)
public @interface EqualsAndHashCode
equals
and hashCode
methods inherited by all objects, based on relevant fields.
Complete documentation is found at the project lombok features page for @EqualsAndHashCode.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
callSuper
Call on the superclass's implementations of
equals and hashCode before calculating
for the fields in this class. |
boolean |
doNotUseGetters
Normally, if getters are available, those are called.
|
java.lang.String[] |
exclude
Any fields listed here will not be taken into account in the generated
equals and hashCode implementations. |
java.lang.String[] |
of
If present, explicitly lists the fields that are to be used for identity.
|
EqualsAndHashCode.AnyAnnotation[] |
onParam
Any annotations listed here are put on the generated parameter of
equals and canEqual . |
public abstract java.lang.String[] exclude
equals
and hashCode
implementations.
Mutually exclusive with of()
.public abstract java.lang.String[] of
Mutually exclusive with exclude()
.
public abstract boolean callSuper
equals
and hashCode
before calculating
for the fields in this class.
default: falsepublic abstract boolean doNotUseGetters
true
.
default: falsepublic abstract EqualsAndHashCode.AnyAnnotation[] onParam
equals
and canEqual
. The syntax for this feature is: @EqualsAndHashCode(onParam=@__({@AnnotationsGoHere}))
This is useful to add for example a Nullable
annotation.Copyright © 2009-2015 The Project Lombok Authors, licensed under the MIT licence.