Class RecursiveComparisonConfiguration
- java.lang.Object
-
- org.assertj.core.api.recursive.comparison.RecursiveComparisonConfiguration
-
public class RecursiveComparisonConfiguration extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRecursiveComparisonConfiguration.BuilderBuilder to buildRecursiveComparisonConfiguration.
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description RecursiveComparisonConfiguration()privateRecursiveComparisonConfiguration(RecursiveComparisonConfiguration.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static Class<?>asWrapperIfPrimitiveType(Class<?> type)static RecursiveComparisonConfiguration.Builderbuilder()Creates builder to buildRecursiveComparisonConfiguration.Stream<Map.Entry<String,Comparator<?>>>comparatorByFields()(package private) Stream<Map.Entry<Class<?>,Comparator<?>>>comparatorByTypes()voidcompareOnlyFields(String... fieldNamesToCompare)Adds the given fields and their subfields to the set of fields from the object under test to compare (no other fields will be compared).private voiddescribeComparatorForFields(StringBuilder description)private voiddescribeComparatorForTypes(StringBuilder description)private StringdescribeComparedFields()private voiddescribeComparedFields(StringBuilder description)private voiddescribeErrorMessagesForFields(StringBuilder description)private voiddescribeErrorMessagesForType(StringBuilder description)private voiddescribeIgnoreAllActualEmptyOptionalFields(StringBuilder description)private voiddescribeIgnoreAllActualNullFields(StringBuilder description)private voiddescribeIgnoreAllExpectedNullFields(StringBuilder description)private voiddescribeIgnoreCollectionOrder(StringBuilder description)private StringdescribeIgnoredCollectionOrderInFields()private voiddescribeIgnoredCollectionOrderInFields(StringBuilder description)private voiddescribeIgnoredCollectionOrderInFieldsMatchingRegexes(StringBuilder description)private StringdescribeIgnoredFields()private voiddescribeIgnoredFields(StringBuilder description)private voiddescribeIgnoredFieldsForTypes(StringBuilder description)private voiddescribeIgnoredFieldsRegexes(StringBuilder description)private StringdescribeIgnoredOverriddenEqualsForFields()private StringdescribeIgnoredOverriddenEqualsForTypes(Representation representation)private voiddescribeIgnoredOverriddenEqualsMethods(StringBuilder description, Representation representation)private StringdescribeIgnoredTypes()private voiddescribeOverriddenEqualsMethodsUsage(StringBuilder description, Representation representation)private StringdescribeRegexes(List<Pattern> regexes)private voiddescribeRegisteredComparatorByTypes(StringBuilder description)private voiddescribeRegisteredComparatorForFields(StringBuilder description)private voiddescribeRegisteredErrorMessagesForFields(StringBuilder description)private voiddescribeRegisteredErrorMessagesForTypes(StringBuilder description)private voiddescribeTypeCheckingStrictness(StringBuilder description)private static DualValuedualValueForField(DualValue parentDualValue, String fieldName)booleanequals(Object obj)private StringformatRegisteredComparatorByType(Map.Entry<Class<?>,Comparator<?>> next)private StringformatRegisteredComparatorForField(Map.Entry<String,Comparator<?>> comparatorForField)Comparator<?>getComparatorForField(String fieldName)Comparator<?>getComparatorForType(Class<?> fieldType)Set<String>getComparedFields()Returns the set of fields to compare from the object under test (no other fields will be compared).FieldComparatorsgetFieldComparators()(package private) booleangetIgnoreAllActualEmptyOptionalFields()(package private) booleangetIgnoreAllActualNullFields()(package private) booleangetIgnoreAllExpectedNullFields()(package private) booleangetIgnoreAllOverriddenEquals()(package private) booleangetIgnoreCollectionOrder()Set<String>getIgnoredCollectionOrderInFields()Returns the list fields from the object under test to ignore collection order in the recursive comparison.List<Pattern>getIgnoredCollectionOrderInFieldsMatchingRegexes()Returns the list of regexes used to find the object under test fields to ignore collection order in the recursive comparison.Set<String>getIgnoredFields()Returns the set of fields from the object under test to ignore in the recursive comparison.List<Pattern>getIgnoredFieldsRegexes()List<String>getIgnoredOverriddenEqualsForFields()List<Pattern>getIgnoredOverriddenEqualsForFieldsMatchingRegexes()List<Class<?>>getIgnoredOverriddenEqualsForTypes()Set<Class<?>>getIgnoredTypes()Returns the set of fields from the object under test types to ignore in the recursive comparison.StringgetMessageForField(String fieldName)StringgetMessageForType(Class<?> fieldType)(package private) Set<String>getNonIgnoredActualFieldNames(DualValue dualValue)org.assertj.core.internal.TypeComparatorsgetTypeComparators()booleanhasComparatorForField(String fieldName)booleanhasComparatorForType(Class<?> keyType)(package private) booleanhasCustomComparator(DualValue dualValue)booleanhasCustomComparators()booleanhasCustomMessageForField(String fieldName)booleanhasCustomMessageForType(Class<?> fieldType)inthashCode()voidignoreAllOverriddenEquals()Force a recursive comparison on all fields (except java types).voidignoreCollectionOrder(boolean ignoreCollectionOrder)Sets whether to ignore collection order in the comparison.voidignoreCollectionOrderInFields(String... fieldsToIgnoreCollectionOrder)Adds the given fields to the list fields from the object under test to ignore collection order in the recursive comparison.voidignoreCollectionOrderInFieldsMatchingRegexes(String... regexes)Adds the given regexes to the list of regexes used to find the object under test fields to ignore collection order in the recursive comparison.voidignoreFields(String... fieldsToIgnore)Adds the given fields to the set of fields from the object under test to ignore in the recursive comparison.voidignoreFieldsMatchingRegexes(String... regexes)Allows to ignore in the recursive comparison the object under test fields matching the given regexes.voidignoreFieldsOfTypes(Class<?>... types)Adds the given types to the list fields from the object under test types to ignore in the recursive comparison.voidignoreOverriddenEqualsForFields(String... fields)Adds the given fields to the list of fields to force a recursive comparison on.voidignoreOverriddenEqualsForFieldsMatchingRegexes(String... regexes)Adds the given regexes to the list of regexes used find the fields to force a recursive comparison on.voidignoreOverriddenEqualsForTypes(Class<?>... types)Adds the given types to the list of types to force a recursive comparison on.private booleanisConfiguredToIgnoreSomeButNotAllOverriddenEqualsMethods()booleanisInStrictTypeCheckingMode()private static Stringjoin(Collection<String> typesDescription)private booleanmatchesAnIgnoredCollectionOrderInField(FieldLocation fieldLocation)private booleanmatchesAnIgnoredCollectionOrderInFieldRegex(FieldLocation fieldLocation)private booleanmatchesAnIgnoredEmptyOptionalField(DualValue dualValue)private booleanmatchesAnIgnoredField(FieldLocation fieldLocation)private booleanmatchesAnIgnoredFieldRegex(FieldLocation fieldLocation)private booleanmatchesAnIgnoredFieldType(DualValue dualValue)private booleanmatchesAnIgnoredNullField(DualValue dualValue)private booleanmatchesAnIgnoredOverriddenEqualsField(FieldLocation fieldLocation)private booleanmatchesAnIgnoredOverriddenEqualsRegex(Class<?> clazz)private booleanmatchesAnIgnoredOverriddenEqualsType(Class<?> clazz)private static Predicate<String>matchesComparedField(FieldLocation field)StringmultiLineDescription(Representation representation)voidregisterComparatorForFields(Comparator<?> comparator, String... fieldLocations)Registers the givenComparatorto compare the fields at the given locations.<T> voidregisterComparatorForType(Comparator<? super T> comparator, Class<T> type)Registers the givenComparatorto compare the fields with the given type.voidregisterEqualsForFields(BiPredicate<?,?> equals, String... fieldLocations)Registers the givenBiPredicateto compare the fields at the given locations.<T> voidregisterEqualsForType(BiPredicate<? super T,? super T> equals, Class<T> type)Registers the givenBiPredicateto compare the fields with the given type.voidregisterErrorMessageForFields(String message, String... fieldLocations)Registers the giving message which would be shown when differences in the given fields while comparison occurred.voidregisterErrorMessageForType(String message, Class<?> clazz)Registers the giving message which would be shown when differences for the giving type while comparison occurred.voidsetIgnoreAllActualEmptyOptionalFields(boolean ignoringAllActualEmptyOptionalFields)Sets whether actual empty optional fields are ignored in the recursive comparison.voidsetIgnoreAllActualNullFields(boolean ignoreAllActualNullFields)Sets whether actual null fields are ignored in the recursive comparison.voidsetIgnoreAllExpectedNullFields(boolean ignoreAllExpectedNullFields)Sets whether expected null fields are ignored in the recursive comparison.private booleanshouldBeCompared(FieldLocation fieldLocation)(package private) booleanshouldIgnore(DualValue dualValue)(package private) booleanshouldIgnoreCollectionOrder(FieldLocation fieldLocation)private booleanshouldIgnoreFieldBasedOnFieldLocation(FieldLocation fieldLocation)private booleanshouldIgnoreFieldBasedOnFieldValue(DualValue dualValue)(package private) booleanshouldIgnoreOverriddenEqualsOf(Class<?> clazz)(package private) booleanshouldIgnoreOverriddenEqualsOf(DualValue dualValue)voidstrictTypeChecking(boolean strictTypeChecking)Sets whether the recursive comparison will check that actual's type is compatible with expected's type (the same applies for each field).private static ComparatortoComparator(BiPredicate equals)StringtoString()voiduseOverriddenEquals()Force a recursive comparison on all fields (except java types).
-
-
-
Field Detail
-
DEFAULT_DELIMITER
private static final String DEFAULT_DELIMITER
- See Also:
- Constant Field Values
-
DEFAULT_IGNORE_ALL_OVERRIDDEN_EQUALS
private static final boolean DEFAULT_IGNORE_ALL_OVERRIDDEN_EQUALS
- See Also:
- Constant Field Values
-
INDENT_LEVEL_2
public static final String INDENT_LEVEL_2
- See Also:
- Constant Field Values
-
strictTypeChecking
private boolean strictTypeChecking
-
ignoreAllActualNullFields
private boolean ignoreAllActualNullFields
-
ignoreAllActualEmptyOptionalFields
private boolean ignoreAllActualEmptyOptionalFields
-
ignoreAllExpectedNullFields
private boolean ignoreAllExpectedNullFields
-
ignoredOverriddenEqualsForFieldsMatchingRegexes
private List<Pattern> ignoredOverriddenEqualsForFieldsMatchingRegexes
-
ignoreAllOverriddenEquals
private boolean ignoreAllOverriddenEquals
-
ignoreCollectionOrder
private boolean ignoreCollectionOrder
-
ignoredCollectionOrderInFieldsMatchingRegexes
private List<Pattern> ignoredCollectionOrderInFieldsMatchingRegexes
-
typeComparators
private org.assertj.core.internal.TypeComparators typeComparators
-
fieldComparators
private FieldComparators fieldComparators
-
typeMessages
private org.assertj.core.internal.TypeMessages typeMessages
-
fieldMessages
private FieldMessages fieldMessages
-
-
Constructor Detail
-
RecursiveComparisonConfiguration
private RecursiveComparisonConfiguration(RecursiveComparisonConfiguration.Builder builder)
-
RecursiveComparisonConfiguration
public RecursiveComparisonConfiguration()
-
-
Method Detail
-
hasComparatorForField
public boolean hasComparatorForField(String fieldName)
-
getComparatorForField
public Comparator<?> getComparatorForField(String fieldName)
-
hasCustomMessageForField
public boolean hasCustomMessageForField(String fieldName)
-
getFieldComparators
public FieldComparators getFieldComparators()
-
hasComparatorForType
public boolean hasComparatorForType(Class<?> keyType)
-
hasCustomComparators
public boolean hasCustomComparators()
-
getComparatorForType
public Comparator<?> getComparatorForType(Class<?> fieldType)
-
hasCustomMessageForType
public boolean hasCustomMessageForType(Class<?> fieldType)
-
getTypeComparators
public org.assertj.core.internal.TypeComparators getTypeComparators()
-
comparatorByTypes
Stream<Map.Entry<Class<?>,Comparator<?>>> comparatorByTypes()
-
getIgnoreAllActualNullFields
boolean getIgnoreAllActualNullFields()
-
getIgnoreAllExpectedNullFields
boolean getIgnoreAllExpectedNullFields()
-
getIgnoreAllOverriddenEquals
boolean getIgnoreAllOverriddenEquals()
-
setIgnoreAllActualEmptyOptionalFields
public void setIgnoreAllActualEmptyOptionalFields(boolean ignoringAllActualEmptyOptionalFields)
Sets whether actual empty optional fields are ignored in the recursive comparison.See
RecursiveComparisonAssert.ignoringActualNullFields()for code examples.- Parameters:
ignoringAllActualEmptyOptionalFields- whether to ignore actual empty optional fields in the recursive comparison
-
getIgnoreAllActualEmptyOptionalFields
boolean getIgnoreAllActualEmptyOptionalFields()
-
setIgnoreAllActualNullFields
public void setIgnoreAllActualNullFields(boolean ignoreAllActualNullFields)
Sets whether actual null fields are ignored in the recursive comparison.See
RecursiveComparisonAssert.ignoringActualNullFields()for code examples.- Parameters:
ignoreAllActualNullFields- whether to ignore actual null fields in the recursive comparison
-
setIgnoreAllExpectedNullFields
public void setIgnoreAllExpectedNullFields(boolean ignoreAllExpectedNullFields)
Sets whether expected null fields are ignored in the recursive comparison.See
RecursiveComparisonAssert.ignoringExpectedNullFields()for code examples.- Parameters:
ignoreAllExpectedNullFields- whether to ignore expected null fields in the recursive comparison
-
ignoreFields
public void ignoreFields(String... fieldsToIgnore)
Adds the given fields to the set of fields from the object under test to ignore in the recursive comparison.The fields are ignored by name, not by value.
See
RecursiveComparisonAssert#ignoringFields(String...)for examples.- Parameters:
fieldsToIgnore- the fields of the object under test to ignore in the comparison.
-
compareOnlyFields
public void compareOnlyFields(String... fieldNamesToCompare)
Adds the given fields and their subfields to the set of fields from the object under test to compare (no other fields will be compared).The fields are specified by name, not by value, you can specify
person.namebut not"Jack"as"Jack"is not a field value.Specifying a field will make all its subfields to be compared, for example specifying
personwill lead to compareperson.name,person.address... on the other hand if you specifyperson.name,personwon't be compared butperson.namewill be.See
RecursiveComparisonAssert#comparingOnlyFields(String...)for examples.- Parameters:
fieldNamesToCompare- the fields of the object under test to compare in the comparison.
-
ignoreFieldsMatchingRegexes
public void ignoreFieldsMatchingRegexes(String... regexes)
Allows to ignore in the recursive comparison the object under test fields matching the given regexes. The given regexes are added to the already registered ones.See
RecursiveComparisonAssert#ignoringFieldsMatchingRegexes(String...)for examples.- Parameters:
regexes- regexes used to ignore fields in the comparison.
-
ignoreFieldsOfTypes
public void ignoreFieldsOfTypes(Class<?>... types)
Adds the given types to the list fields from the object under test types to ignore in the recursive comparison. The fields are ignored if their types exactly match one of the ignored types, if a field is a subtype of an ignored type it won't be ignored.Note that if some object under test fields are null, they are not ignored by this method as their type can't be evaluated.
See
RecursiveComparisonAssert#ignoringFieldsOfTypes(Class...)for examples.- Parameters:
types- the types of the object under test to ignore in the comparison.
-
getIgnoredFields
public Set<String> getIgnoredFields()
Returns the set of fields from the object under test to ignore in the recursive comparison.- Returns:
- the set of fields from the object under test to ignore in the recursive comparison.
-
getComparedFields
public Set<String> getComparedFields()
Returns the set of fields to compare from the object under test (no other fields will be compared).- Returns:
- the set of fields from the object under test to compare.
-
getIgnoredTypes
public Set<Class<?>> getIgnoredTypes()
Returns the set of fields from the object under test types to ignore in the recursive comparison.- Returns:
- the set of fields from the object under test types to ignore in the recursive comparison.
-
ignoreAllOverriddenEquals
public void ignoreAllOverriddenEquals()
Force a recursive comparison on all fields (except java types).See
RecursiveComparisonAssert.ignoringAllOverriddenEquals()for examples.
-
useOverriddenEquals
public void useOverriddenEquals()
Force a recursive comparison on all fields (except java types).See
RecursiveComparisonAssert.usingOverriddenEquals()for examples.
-
ignoreOverriddenEqualsForFields
public void ignoreOverriddenEqualsForFields(String... fields)
Adds the given fields to the list of fields to force a recursive comparison on.See
RecursiveComparisonAssert#ignoringOverriddenEqualsForFields(String...)for examples.- Parameters:
fields- the fields to force a recursive comparison on.
-
ignoreOverriddenEqualsForFieldsMatchingRegexes
public void ignoreOverriddenEqualsForFieldsMatchingRegexes(String... regexes)
Adds the given regexes to the list of regexes used find the fields to force a recursive comparison on.See
RecursiveComparisonAssert#ignoringOverriddenEqualsForFieldsMatchingRegexes(String...)for examples.- Parameters:
regexes- regexes used to specify the fields we want to force a recursive comparison on.
-
ignoreOverriddenEqualsForTypes
public void ignoreOverriddenEqualsForTypes(Class<?>... types)
Adds the given types to the list of types to force a recursive comparison on.See
RecursiveComparisonAssert#ignoringOverriddenEqualsForTypes(Class...)for examples.- Parameters:
types- the types to the list of types to force a recursive comparison on.
-
getIgnoreCollectionOrder
boolean getIgnoreCollectionOrder()
-
ignoreCollectionOrder
public void ignoreCollectionOrder(boolean ignoreCollectionOrder)
Sets whether to ignore collection order in the comparison.See
RecursiveComparisonAssert.ignoringCollectionOrder()for code examples.- Parameters:
ignoreCollectionOrder- whether to ignore collection order in the comparison.
-
ignoreCollectionOrderInFields
public void ignoreCollectionOrderInFields(String... fieldsToIgnoreCollectionOrder)
Adds the given fields to the list fields from the object under test to ignore collection order in the recursive comparison.See
RecursiveComparisonAssert#ignoringCollectionOrderInFields(String...)for examples.- Parameters:
fieldsToIgnoreCollectionOrder- the fields of the object under test to ignore collection order in the comparison.
-
getIgnoredCollectionOrderInFields
public Set<String> getIgnoredCollectionOrderInFields()
Returns the list fields from the object under test to ignore collection order in the recursive comparison.- Returns:
- the list fields from the object under test to ignore collection order in the recursive comparison.
-
ignoreCollectionOrderInFieldsMatchingRegexes
public void ignoreCollectionOrderInFieldsMatchingRegexes(String... regexes)
Adds the given regexes to the list of regexes used to find the object under test fields to ignore collection order in the recursive comparison.See
RecursiveComparisonAssert#ignoringCollectionOrderInFieldsMatchingRegexes(String...)for examples.- Parameters:
regexes- regexes used to find the object under test fields to ignore collection order in in the comparison.
-
getIgnoredCollectionOrderInFieldsMatchingRegexes
public List<Pattern> getIgnoredCollectionOrderInFieldsMatchingRegexes()
Returns the list of regexes used to find the object under test fields to ignore collection order in the recursive comparison.- Returns:
- the list of regexes used to find the object under test fields to ignore collection order in the recursive comparison.
-
registerComparatorForType
public <T> void registerComparatorForType(Comparator<? super T> comparator, Class<T> type)
Registers the givenComparatorto compare the fields with the given type.Comparators registered with this method have less precedence than comparators registered with
registerComparatorForFields(Comparator, String...).Note that registering a
Comparatorfor a given type will override the previously registered BiPredicate/Comparator (if any).See
RecursiveComparisonAssert.withComparatorForType(Comparator, Class)for examples.- Type Parameters:
T- the class type to register a comparator for- Parameters:
comparator- theComparatorto use to compare the given typetype- the type to be compared with the given comparator.- Throws:
NullPointerException- if the given comparator is null.
-
registerEqualsForType
public <T> void registerEqualsForType(BiPredicate<? super T,? super T> equals, Class<T> type)
Registers the givenBiPredicateto compare the fields with the given type.BiPredicates specified with this method have less precedence than the ones registered with
registerEqualsForFields(BiPredicate, String...)or comparators registered withregisterComparatorForFields(Comparator, String...).Note that registering a
BiPredicatefor a given type will override the previously registered BiPredicate/Comparator (if any).See
RecursiveComparisonAssert.withEqualsForType(BiPredicate, Class)for examples.- Type Parameters:
T- the class type to register a comparator for- Parameters:
equals- the equals implementation to compare the given typetype- the type to be compared with the given equals implementation .- Throws:
NullPointerException- if the given BiPredicate is null.- Since:
- 3.17.0
-
registerComparatorForFields
public void registerComparatorForFields(Comparator<?> comparator, String... fieldLocations)
Registers the givenComparatorto compare the fields at the given locations.The fields must be specified from the root object, for example if
Foohas aBarfield and both have anidfield, one can register a comparator for Foo and Bar'sidby calling:registerComparatorForFields(idComparator, "foo.id", "foo.bar.id")Comparators registered with this method have precedence over comparators registered with
registerComparatorForType(Comparator, Class).Note that registering a
Comparatorfor a given field will override the previously registered BiPredicate/Comparator (if any).See
RecursiveComparisonAssert#withComparatorForFields(Comparator, String...)for examples.- Parameters:
comparator- theComparatorto use to compare the given fieldfieldLocations- the locations from the root object of the fields the comparator should be used for- Throws:
NullPointerException- if the given comparator is null.
-
registerEqualsForFields
public void registerEqualsForFields(BiPredicate<?,?> equals, String... fieldLocations)
Registers the givenBiPredicateto compare the fields at the given locations.The fields must be specified from the root object, for example if
Foohas aBarfield and both have anidfield, one can register a BiPredicate for Foo and Bar'sidby calling:registerEqualsForFields(idBiPredicate, "foo.id", "foo.bar.id")BiPredicates registered with this method have precedence over the ones registered with
registerEqualsForType(BiPredicate, Class)or the comparators registered withregisterComparatorForType(Comparator, Class).Note that registering a
BiPredicatefor a given field will override the previously registered BiPredicate/Comparator (if any).See
RecursiveComparisonAssert#withEqualsForFields(BiPredicate, String...)for examples.- Parameters:
equals- the equals implementation to compare the given fields.fieldLocations- the locations from the root object of the fields the comparator should be used for- Throws:
NullPointerException- if the given BiPredicate is null.- Since:
- 3.17.0
-
registerErrorMessageForFields
public void registerErrorMessageForFields(String message, String... fieldLocations)
Registers the giving message which would be shown when differences in the given fields while comparison occurred.The fields must be specified from the root object, for example if
Foohas aBarfield and both have anidfield, one can register a message for Foo and Bar'sidby calling:registerErrorMessageForFields("some message", "foo.id", "foo.bar.id")Messages registered with this method have precedence over the ones registered with
registerErrorMessageForType(String, Class).In case of
nullas message the default error message will be used (SeeComparisonDifference.DEFAULT_TEMPLATE).- Parameters:
message- the error message that will be thrown when comparison error occurredfieldLocations- the field locations the error message should be used for
-
registerErrorMessageForType
public void registerErrorMessageForType(String message, Class<?> clazz)
Registers the giving message which would be shown when differences for the giving type while comparison occurred.Message registered with this method have less precedence than the ones registered with
registerErrorMessageForFields(String, String...).In case of
nullas message the default error message will be used (SeeComparisonDifference.DEFAULT_TEMPLATE).- Parameters:
message- the error message that will be thrown when comparison error occurredclazz- the type the error message should be used for
-
strictTypeChecking
public void strictTypeChecking(boolean strictTypeChecking)
Sets whether the recursive comparison will check that actual's type is compatible with expected's type (the same applies for each field). Compatible means that the expected's type is the same or a subclass of actual's type.See
RecursiveComparisonAssert.withStrictTypeChecking()for code examples.- Parameters:
strictTypeChecking- whether the recursive comparison will check that actual's type is compatible with expected's type.
-
isInStrictTypeCheckingMode
public boolean isInStrictTypeCheckingMode()
-
getIgnoredOverriddenEqualsForFieldsMatchingRegexes
public List<Pattern> getIgnoredOverriddenEqualsForFieldsMatchingRegexes()
-
comparatorByFields
public Stream<Map.Entry<String,Comparator<?>>> comparatorByFields()
-
multiLineDescription
public String multiLineDescription(Representation representation)
-
shouldIgnore
boolean shouldIgnore(DualValue dualValue)
-
shouldBeCompared
private boolean shouldBeCompared(FieldLocation fieldLocation)
-
matchesComparedField
private static Predicate<String> matchesComparedField(FieldLocation field)
-
shouldIgnoreFieldBasedOnFieldValue
private boolean shouldIgnoreFieldBasedOnFieldValue(DualValue dualValue)
-
shouldIgnoreFieldBasedOnFieldLocation
private boolean shouldIgnoreFieldBasedOnFieldLocation(FieldLocation fieldLocation)
-
dualValueForField
private static DualValue dualValueForField(DualValue parentDualValue, String fieldName)
-
hasCustomComparator
boolean hasCustomComparator(DualValue dualValue)
-
shouldIgnoreOverriddenEqualsOf
boolean shouldIgnoreOverriddenEqualsOf(DualValue dualValue)
-
shouldIgnoreOverriddenEqualsOf
boolean shouldIgnoreOverriddenEqualsOf(Class<?> clazz)
-
shouldIgnoreCollectionOrder
boolean shouldIgnoreCollectionOrder(FieldLocation fieldLocation)
-
describeIgnoredFieldsRegexes
private void describeIgnoredFieldsRegexes(StringBuilder description)
-
describeIgnoredFields
private void describeIgnoredFields(StringBuilder description)
-
describeComparedFields
private void describeComparedFields(StringBuilder description)
-
describeIgnoredFieldsForTypes
private void describeIgnoredFieldsForTypes(StringBuilder description)
-
describeIgnoreAllActualNullFields
private void describeIgnoreAllActualNullFields(StringBuilder description)
-
describeIgnoreAllActualEmptyOptionalFields
private void describeIgnoreAllActualEmptyOptionalFields(StringBuilder description)
-
describeIgnoreAllExpectedNullFields
private void describeIgnoreAllExpectedNullFields(StringBuilder description)
-
describeOverriddenEqualsMethodsUsage
private void describeOverriddenEqualsMethodsUsage(StringBuilder description, Representation representation)
-
describeIgnoredOverriddenEqualsMethods
private void describeIgnoredOverriddenEqualsMethods(StringBuilder description, Representation representation)
-
describeIgnoredOverriddenEqualsForTypes
private String describeIgnoredOverriddenEqualsForTypes(Representation representation)
-
describeIgnoredOverriddenEqualsForFields
private String describeIgnoredOverriddenEqualsForFields()
-
describeIgnoreCollectionOrder
private void describeIgnoreCollectionOrder(StringBuilder description)
-
describeIgnoredCollectionOrderInFields
private void describeIgnoredCollectionOrderInFields(StringBuilder description)
-
describeIgnoredCollectionOrderInFieldsMatchingRegexes
private void describeIgnoredCollectionOrderInFieldsMatchingRegexes(StringBuilder description)
-
matchesAnIgnoredOverriddenEqualsRegex
private boolean matchesAnIgnoredOverriddenEqualsRegex(Class<?> clazz)
-
matchesAnIgnoredOverriddenEqualsType
private boolean matchesAnIgnoredOverriddenEqualsType(Class<?> clazz)
-
matchesAnIgnoredOverriddenEqualsField
private boolean matchesAnIgnoredOverriddenEqualsField(FieldLocation fieldLocation)
-
matchesAnIgnoredNullField
private boolean matchesAnIgnoredNullField(DualValue dualValue)
-
matchesAnIgnoredEmptyOptionalField
private boolean matchesAnIgnoredEmptyOptionalField(DualValue dualValue)
-
matchesAnIgnoredFieldRegex
private boolean matchesAnIgnoredFieldRegex(FieldLocation fieldLocation)
-
matchesAnIgnoredFieldType
private boolean matchesAnIgnoredFieldType(DualValue dualValue)
-
matchesAnIgnoredField
private boolean matchesAnIgnoredField(FieldLocation fieldLocation)
-
matchesAnIgnoredCollectionOrderInField
private boolean matchesAnIgnoredCollectionOrderInField(FieldLocation fieldLocation)
-
matchesAnIgnoredCollectionOrderInFieldRegex
private boolean matchesAnIgnoredCollectionOrderInFieldRegex(FieldLocation fieldLocation)
-
describeIgnoredFields
private String describeIgnoredFields()
-
describeComparedFields
private String describeComparedFields()
-
describeIgnoredTypes
private String describeIgnoredTypes()
-
join
private static String join(Collection<String> typesDescription)
-
describeIgnoredCollectionOrderInFields
private String describeIgnoredCollectionOrderInFields()
-
isConfiguredToIgnoreSomeButNotAllOverriddenEqualsMethods
private boolean isConfiguredToIgnoreSomeButNotAllOverriddenEqualsMethods()
-
describeRegisteredComparatorByTypes
private void describeRegisteredComparatorByTypes(StringBuilder description)
-
describeComparatorForTypes
private void describeComparatorForTypes(StringBuilder description)
-
formatRegisteredComparatorByType
private String formatRegisteredComparatorByType(Map.Entry<Class<?>,Comparator<?>> next)
-
describeRegisteredComparatorForFields
private void describeRegisteredComparatorForFields(StringBuilder description)
-
describeComparatorForFields
private void describeComparatorForFields(StringBuilder description)
-
formatRegisteredComparatorForField
private String formatRegisteredComparatorForField(Map.Entry<String,Comparator<?>> comparatorForField)
-
describeTypeCheckingStrictness
private void describeTypeCheckingStrictness(StringBuilder description)
-
describeRegisteredErrorMessagesForFields
private void describeRegisteredErrorMessagesForFields(StringBuilder description)
-
describeErrorMessagesForFields
private void describeErrorMessagesForFields(StringBuilder description)
-
describeRegisteredErrorMessagesForTypes
private void describeRegisteredErrorMessagesForTypes(StringBuilder description)
-
describeErrorMessagesForType
private void describeErrorMessagesForType(StringBuilder description)
-
builder
public static RecursiveComparisonConfiguration.Builder builder()
Creates builder to buildRecursiveComparisonConfiguration.- Returns:
- created builder
-
toComparator
private static Comparator toComparator(BiPredicate equals)
-
-