Object#equals(Object) that takes a class's declared fields into consideration. Equality is resolved by comparing two
instances of the same or a compatible class field by field where reference fields must either both be null or where the field value of
the instance upon which the method is invoked returns true upon calling the value's equals method. For arrays, the corresponding
utilities of java.util.Arrays are used.
| Modifier and Type | Class and Description |
|---|---|
| protected static class | EqualsMethod.
A byte code appender to implement the |
| protected static class | EqualsMethod.
A compound comparator that compares the values of multiple fields. |
| protected static class | EqualsMethod.
A conditional return aborts the equality computation if a given condition was reached. |
| protected static enum | EqualsMethod.
A comparator that retains the natural order. |
| protected static interface | EqualsMethod.
Guards a field value against a potential |
| protected static enum | EqualsMethod.
Checks the equality contract against the super class. |
| protected static enum | EqualsMethod.
Checks the overall type of the provided argument. |
| protected static enum | EqualsMethod.
A comparator that sorts fields by a type property. |
| protected static enum | EqualsMethod.
A value comparator is responsible to compare to values of a given type. |
| Modifier and Type | Field and Description |
|---|---|
| private final Comparator | comparator
The comparator to apply for ordering fields. |
| private static final MethodDescription. | EQUALS
The |
| private final ElementMatcher. | ignored
A matcher to filter fields that should not be used for a equality resolution. |
| private final ElementMatcher. | nonNullable
A matcher to determine fields of a reference type that cannot be |
| private final EqualsMethod. | superClassCheck
The baseline equality to check. |
| private final EqualsMethod. | typeCompatibilityCheck
The instance type compatibility check. |
| Access | Constructor and Description |
|---|---|
| protected | EqualsMethod(EqualsMethod.
The baseline equality to check. superClassCheckCreates a new equals method implementation. |
| private | EqualsMethod(EqualsMethod.
The baseline equality to check. superClassCheck,The instance type compatibility check. typeCompatibilityCheck,A matcher to filter fields that should not be used for a equality resolution. ignored,A matcher to determine fields of a reference type that cannot be nonNullable,null.The comparator to apply for ordering fields. comparator)Creates a new equals method implementation. |
| Modifier and Type | Method and Description |
|---|---|
| public ByteCodeAppender | appender(Implementation.
The target of the current implementation. implementationTargetImplements org. |
| public static EqualsMethod | Returns: An equals method implementation that does not invoke the super class'sObject#equals(Object) method.Creates an equals method implementation that does not invoke the super class's |
| public InstrumentedType | prepare(InstrumentedType
The instrumented type in its current form. instrumentedType)Implements org. |
| public static EqualsMethod | Returns: An equals implementation that invokes the super class'sObject#equals(Object) method first.Creates an equals implementation that invokes the super class's |
| public EqualsMethod | Returns: A new version of this equals method that compares enumeration-typed fields before fields with non-enumeration-typed fields.Returns a new version of this equals method that compares fields with enumeration types prior to fields with non-enumeration types. |
| public EqualsMethod | Returns: A new version of this equals method that sorts fields in their application order using the supplied comparator.The comparator to apply. comparator)Applies the supplied comparator to determine an order for fields for being compared. |
| public EqualsMethod | Returns: A new version of this equals method implementation that also ignores any fields matched by the provided matcher.A matcher to specify any fields that should be ignored. ignored)Returns a new version of this equals method implementation that ignores the specified fields additionally to any previously specified fields. |
| public EqualsMethod | Returns: A new version of this equals method implementation that also does not applynull value checks to any fields matched by
the provided matcher.A matcher to specify any fields that should not be guarded against nonNullable)null values.Returns a new version of this equals method implementation that does not apply a |
| public EqualsMethod | Returns: A new version of this equals method that compares primitive-typed fields before fields with non-primitive-typed fields.Returns a new version of this equals method that compares fields with primitive types prior to fields with non-primitive types. |
| public EqualsMethod | Returns: A new version of this equals method that compares primitive wrapper-typed fields before fields with non-primitive wrapper-typed fields.Returns a new version of this equals method that compares fields with primitive wrapper types prior to fields with non-primitive wrapper types. |
| public EqualsMethod | withStringTypedFieldsFirst()
Returns a new version of this equals method that compares fields with |
| public Implementation | Returns: A new version of this equals method implementation that permits subclasses of the instrumented type to be equal to instances of the instrumented type instead of requiring an exact match.Returns a new version of this equals method implementation that permits subclasses of the instrumented type to be equal to instances of the instrumented type instead of requiring an exact match. |