Class InstanceOfAssertFactory<T,​ASSERT extends AbstractAssert<?,​?>>

  • Type Parameters:
    T - the type to use for the cast.
    ASSERT - the type of the resulting Assert.
    All Implemented Interfaces:
    AssertFactory<Object,​ASSERT>

    public class InstanceOfAssertFactory<T,​ASSERT extends AbstractAssert<?,​?>>
    extends Object
    implements AssertFactory<Object,​ASSERT>
    AssertFactory decorator which casts the input value to the given type before invoking the decorated AssertFactory.
    Since:
    3.13.0
    Author:
    Stefano Cordio
    • Constructor Detail

      • InstanceOfAssertFactory

        public InstanceOfAssertFactory​(Class<T> type,
                                       AssertFactory<T,​ASSERT> assertFactory)
        Instantiates a new InstanceOfAssertFactory.
        Parameters:
        type - the Class instance of the given type.
        assertFactory - the AssertFactory to decorate.
    • Method Detail

      • createAssert

        public ASSERT createAssert​(Object value)
        Creates the custom Assert object for the given element value. Typically this will just invoke assertThat(t)
        Specified by:
        createAssert in interface AssertFactory<T,​ASSERT extends AbstractAssert<?,​?>>
        Parameters:
        value - the type to convert to an Assert object
        Returns:
        returns the custom Assert object for the given element value