Interface AssertFactory<T,ASSERT extends Assert<?,?>>

Type Parameters:
T - the type of the input to the factory.
ASSERT - the type of the resulting Assert.
All Known Implementing Classes:
InstanceOfAssertFactory, ObjectAssertFactory
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AssertFactory<T,ASSERT extends Assert<?,?>>
A single method factory interface to create an Assert for a given value. This factory method typically wraps a call to assertThat(t) to produce a concrete assert type ASSERT for the input element of type T.

This interface is typically used by navigation assertions on iterable types like AbstractIterableAssert when calling assertThat(Iterable<E>, AssertFactory<E, ASSERT>)

Since:
2.5.0 / 3.5.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates the custom Assert object for the given element value.
  • Method Details

    • createAssert

      ASSERT createAssert(T t)
      Creates the custom Assert object for the given element value. Typically this will just invoke assertThat(t)
      Parameters:
      t - the type to convert to an Assert object
      Returns:
      returns the custom Assert object for the given element value