Package org.assertj.core.api.recursive
Class AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE extends AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE>>
java.lang.Object
org.assertj.core.api.recursive.AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE>
- Direct Known Subclasses:
RecursiveAssertionConfiguration.Builder
,RecursiveComparisonConfiguration.Builder
- Enclosing class:
AbstractRecursiveOperationConfiguration
protected static class AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE extends AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE>>
extends Object
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]
private String[]
private Class<?>[]
private final BUILDER_TYPE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractBuilder
(Class<? extends AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE>> selfType) -
Method Summary
Modifier and TypeMethodDescriptionwithIgnoredFields
(String... fieldsToIgnore) Adds the given fields to the set of fields from the object under test to ignore in the recursive comparison.withIgnoredFieldsMatchingRegexes
(String... regexes) Allows to ignore in the recursive comparison the object under test fields matching the given regexes.withIgnoredFieldsOfTypes
(Class<?>... types) Adds the given types to the list fields from the object under test types to ignore in the recursive comparison.
-
Field Details
-
thisBuilder
private final BUILDER_TYPE extends AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE> thisBuilder -
ignoredFields
-
ignoredFieldsMatchingRegexes
-
ignoredTypes
-
-
Constructor Details
-
AbstractBuilder
protected AbstractBuilder(Class<? extends AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE>> selfType)
-
-
Method Details
-
withIgnoredFields
Adds the given fields to the set of fields from the object under test to ignore in the recursive comparison. Nested fields can be specified like this: home.address.street.See
RecursiveComparisonAssert#ignoringFields(String...)
for examples.- Parameters:
fieldsToIgnore
- the fields of the object under test to ignore in the comparison.- Returns:
- this builder.
-
withIgnoredFieldsMatchingRegexes
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.- Returns:
- this builder.
-
withIgnoredFieldsOfTypes
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.- Returns:
- this builder.
-