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 Details

  • Constructor Details

  • Method Details

    • withIgnoredFields

      public BUILDER_TYPE withIgnoredFields(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(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(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.