Package org.assertj.core.error
Class ShouldBeInstance
- java.lang.Object
-
- org.assertj.core.error.BasicErrorMessageFactory
-
- org.assertj.core.error.ShouldBeInstance
-
- All Implemented Interfaces:
ErrorMessageFactory
public class ShouldBeInstance extends BasicErrorMessageFactory
Creates an error message indicating that an assertion that verifies that an object is an instance of some type failed.
-
-
Field Summary
-
Fields inherited from class org.assertj.core.error.BasicErrorMessageFactory
arguments, format, formatter
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ShouldBeInstance(java.lang.Object object, java.lang.Class<?> type)
private
ShouldBeInstance(java.lang.String objectDescription, java.lang.Class<?> type)
private
ShouldBeInstance(java.lang.Throwable throwable, java.lang.Class<?> type)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ErrorMessageFactory
shouldBeInstance(java.lang.Object object, java.lang.Class<?> type)
Creates a newShouldBeInstance
.static ErrorMessageFactory
shouldBeInstanceButWasNull(java.lang.String objectDescription, java.lang.Class<?> type)
Creates a newShouldBeInstance
when object we want to check type is null.-
Methods inherited from class org.assertj.core.error.BasicErrorMessageFactory
create, create, create, equals, hashCode, toString, unquotedString
-
-
-
-
Constructor Detail
-
ShouldBeInstance
private ShouldBeInstance(java.lang.Object object, java.lang.Class<?> type)
-
ShouldBeInstance
private ShouldBeInstance(java.lang.Throwable throwable, java.lang.Class<?> type)
-
ShouldBeInstance
private ShouldBeInstance(java.lang.String objectDescription, java.lang.Class<?> type)
-
-
Method Detail
-
shouldBeInstance
public static ErrorMessageFactory shouldBeInstance(java.lang.Object object, java.lang.Class<?> type)
Creates a newShouldBeInstance
.- Parameters:
object
- the object value in the failed assertion.type
- the typeobject
is \nExpecting:\n to belong to.- Returns:
- the created
ErrorMessageFactory
.
-
shouldBeInstanceButWasNull
public static ErrorMessageFactory shouldBeInstanceButWasNull(java.lang.String objectDescription, java.lang.Class<?> type)
Creates a newShouldBeInstance
when object we want to check type is null.- Parameters:
objectDescription
- the description of the null object we wanted to check type.type
- the \nExpecting:\n type.- Returns:
- the created
ErrorMessageFactory
.
-
-