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

    • Method Detail

      • createAssert

        ASSERT createAssert​(T actual)
        Creates the custom Assert instance for the given value.

        Typically, this will just invoke assertThat(actual).

        Parameters:
        actual - the input value for the Assert instance
        Returns:
        the custom Assert instance for the given value
      • createAssert

        default ASSERT createAssert​(AssertFactory.ValueProvider<? extends T> valueProvider)
        Creates the custom Assert instance for the value provided by the given valueProvider.

        This is typically used by custom assertions that want to leverage existing factories and need to manipulate the value upfront.

        The default implementation always requests a value compatible with Object.

        Overriding implementations might provide a more specific Type instance to express the desired type of the value returned by the provider. When doing so, the factory is required to be consistent with the type parameter AssertFactory.

        Parameters:
        valueProvider - the value provider for the Assert instance
        Returns:
        the custom Assert instance for the value provided by the given value provider
        Since:
        3.26.0