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 java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]
ignoredFields
private java.lang.String[]
ignoredFieldsMatchingRegexes
private java.lang.Class<?>[]
ignoredTypes
private BUILDER_TYPE
thisBuilder
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBuilder(java.lang.Class<? extends AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE>> selfType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BUILDER_TYPE
withIgnoredFields(java.lang.String... fieldsToIgnore)
Adds the given fields to the set of fields from the object under test to ignore in the recursive comparison.BUILDER_TYPE
withIgnoredFieldsMatchingRegexes(java.lang.String... regexes)
Allows to ignore in the recursive comparison the object under test fields matching the given regexes.BUILDER_TYPE
withIgnoredFieldsOfTypes(java.lang.Class<?>... types)
Adds the given types to the list fields from the object under test types to ignore in the recursive comparison.
-
-
-
Field Detail
-
thisBuilder
private final BUILDER_TYPE extends AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE> thisBuilder
-
ignoredFields
private java.lang.String[] ignoredFields
-
ignoredFieldsMatchingRegexes
private java.lang.String[] ignoredFieldsMatchingRegexes
-
ignoredTypes
private java.lang.Class<?>[] ignoredTypes
-
-
Constructor Detail
-
AbstractBuilder
protected AbstractBuilder(java.lang.Class<? extends AbstractRecursiveOperationConfiguration.AbstractBuilder<BUILDER_TYPE>> selfType)
-
-
Method Detail
-
withIgnoredFields
public BUILDER_TYPE withIgnoredFields(java.lang.String... fieldsToIgnore)
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
public BUILDER_TYPE withIgnoredFieldsMatchingRegexes(java.lang.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.- Returns:
- this builder.
-
withIgnoredFieldsOfTypes
public BUILDER_TYPE withIgnoredFieldsOfTypes(java.lang.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.- Returns:
- this builder.
-
-