Package org.assertj.core.api
Class InstanceOfAssertFactory<T,ASSERT extends AbstractAssert<?,?>>
- java.lang.Object
-
- org.assertj.core.api.InstanceOfAssertFactory<T,ASSERT>
-
- Type Parameters:
T- the type to use for the cast.ASSERT- the type of the resultingAssert.
- All Implemented Interfaces:
AssertFactory<Object,ASSERT>
public class InstanceOfAssertFactory<T,ASSERT extends AbstractAssert<?,?>> extends Object implements AssertFactory<Object,ASSERT>
AssertFactorydecorator which casts the input value to the given type before invoking the decoratedAssertFactory.- Since:
- 3.13.0
- Author:
- Stefano Cordio
-
-
Field Summary
Fields Modifier and Type Field Description private AssertFactory<T,ASSERT>assertFactoryprivate Class<T>type
-
Constructor Summary
Constructors Constructor Description InstanceOfAssertFactory(Class<T> type, AssertFactory<T,ASSERT> assertFactory)Instantiates a newInstanceOfAssertFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ASSERTcreateAssert(Object value)Creates the custom Assert object for the given element value.(package private) Class<T>getType()
-
-
-
Field Detail
-
assertFactory
private final AssertFactory<T,ASSERT extends AbstractAssert<?,?>> assertFactory
-
-
Constructor Detail
-
InstanceOfAssertFactory
public InstanceOfAssertFactory(Class<T> type, AssertFactory<T,ASSERT> assertFactory)
Instantiates a newInstanceOfAssertFactory.- Parameters:
type- theClassinstance of the given type.assertFactory- theAssertFactoryto decorate.
-
-
Method Detail
-
createAssert
public ASSERT createAssert(Object value)
Creates the custom Assert object for the given element value. Typically this will just invokeassertThat(t)- Specified by:
createAssertin interfaceAssertFactory<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
-
-