Search in sources :

Example 1 with IterableElementComparisonStrategy

use of org.assertj.core.internal.IterableElementComparisonStrategy in project assertj-core by joel-costigliola.

the class AbstractIterableAssert method usingElementComparator.

/**
 * {@inheritDoc}
 */
@Override
@CheckReturnValue
public SELF usingElementComparator(Comparator<? super ELEMENT> elementComparator) {
    this.iterables = new Iterables(new ComparatorBasedComparisonStrategy(elementComparator));
    // to have the same semantics on base assertions like isEqualTo, we need to use an iterable comparator comparing
    // elements with elementComparator parameter
    objects = new Objects(new IterableElementComparisonStrategy<>(elementComparator));
    return myself;
}
Also used : IterableElementComparisonStrategy(org.assertj.core.internal.IterableElementComparisonStrategy) Objects(org.assertj.core.internal.Objects) ComparatorBasedComparisonStrategy(org.assertj.core.internal.ComparatorBasedComparisonStrategy) Iterables(org.assertj.core.internal.Iterables) CheckReturnValue(org.assertj.core.util.CheckReturnValue)

Aggregations

ComparatorBasedComparisonStrategy (org.assertj.core.internal.ComparatorBasedComparisonStrategy)1 IterableElementComparisonStrategy (org.assertj.core.internal.IterableElementComparisonStrategy)1 Iterables (org.assertj.core.internal.Iterables)1 Objects (org.assertj.core.internal.Objects)1 CheckReturnValue (org.assertj.core.util.CheckReturnValue)1