Deprecated
This comparator is deprecated because it performs a shallow field by field comparison, i.e. elements are compared
field by field but the fields are compared with equals, use AbstractIterableAssert#usingRecursiveFieldByFieldElementComparator(RecursiveComparisonConfiguration)
or AbstractObjectAssert#usingRecursiveComparison() instead to perform a true recursive comparison.
Compares objects field/property by field/property including private fields unless
Assertions#setAllowComparingPrivateFields(boolean) has been called with false.
| Modifier and Type | Field and Description |
|---|---|
| protected final Map | |
| protected final TypeComparators |
| Access | Constructor and Description |
|---|---|
| public | FieldByFieldComparator(Map<String, Comparator<?>> comparatorsByPropertyOrField, TypeComparators typeComparators)
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected boolean | |
| public int | compare(Object
the first object to be compared. actual, Object the second object to be compared. other)Implements java. |
| protected String | |
| protected String | |
| protected String | |
| protected String | |
| private static String | |
| private static boolean | |
| public String |
| comparatorsByPropertyOrField | back to summary |
|---|---|
| protected final Map<String, Comparator<?>> comparatorsByPropertyOrField | |
| comparatorsByType | back to summary |
|---|---|
| protected final TypeComparators comparatorsByType | |
| FieldByFieldComparator | back to summary |
|---|---|
| public FieldByFieldComparator(Map<String, Comparator<?>> comparatorsByPropertyOrField, TypeComparators typeComparators) | |
| FieldByFieldComparator | back to summary |
|---|---|
| public FieldByFieldComparator() | |
| areEqual | back to summary |
|---|---|
| protected boolean areEqual(Object actual, Object other) | |
| compare | back to summary |
|---|---|
| public int compare(Object actual, Object other) Implements java. Doc from java. Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
The implementor must ensure that
The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |
| describeFieldComparatorsByName | back to summary |
|---|---|
| protected String describeFieldComparatorsByName() | |
| describeFieldComparatorsByType | back to summary |
|---|---|
| protected String describeFieldComparatorsByType() | |
| describeUsedComparators | back to summary |
|---|---|
| protected String describeUsedComparators() | |
| description | back to summary |
|---|---|
| protected String description() | |
| formatFieldComparator | back to summary |
|---|---|
| private static String formatFieldComparator(Map. | |
| isNullOrEmpty | back to summary |
|---|---|
| private static boolean isNullOrEmpty(TypeComparators comparatorByType) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |