Package org.inferred.freebuilder
Annotation Type IgnoredByEquals
-
@Target(METHOD) @Retention(SOURCE) public @interface IgnoredByEqualsFreeBuilderwill not check properties annotated@IgnoredByEqualswhen comparing objects in its generatedObject.equals(Object).To maintain the contract of
Object.hashCode()), the value of these properties will also be ignored in the generated implementation of that method.Warning: Dropping properties from equality checks makes it very easy to accidentally write broken unit tests (and hard to write good ones). If you find yourself wanting to use this annotation, consider first whether you actually want a different collection type (typicaly a
Maprather than aSet, for instance), or whether you can use an explicit field-ignoringComparatorin the parts of the code that need it.