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<java.lang.Object,​ASSERT>

    public class InstanceOfAssertFactory<T,​ASSERT extends AbstractAssert<?,​?>>
    extends java.lang.Object
    implements AssertFactory<java.lang.Object,​ASSERT>
    AssertFactory decorator which casts the input value to the given type before invoking the decorated AssertFactory.
    Since:
    3.13.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ASSERT createAssert​(java.lang.Object value)
      Creates the custom Assert object for the given element value.
      (package private) java.lang.Class<T> getType()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InstanceOfAssertFactory

        public InstanceOfAssertFactory​(java.lang.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

      • getType

        java.lang.Class<T> getType()
      • createAssert

        public ASSERT createAssert​(java.lang.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