Top Description Fields Constructors Methods
org.assertj.core.error

public Class ShouldBeInstance

extends BasicErrorMessageFactory
Class Inheritance

Creates an error message indicating that an assertion that verifies that an object is an instance of some type failed.
Authors
Alex Ruiz, Joel Costigliola

Field Summary

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
argumentsformatformatter

Constructor Summary

AccessConstructor and Description
private
ShouldBeInstance(Object object, Class<?> type)

private
ShouldBeInstance(Throwable throwable, Class<?> type)

private
ShouldBeInstance(String objectDescription, Class<?> type)

Method Summary

Modifier and TypeMethod and Description
public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBeInstance
(Object
the object value in the failed assertion.
object
,
Class<?>
the type object is \nExpecting:\n to belong to.
type
)

Creates a new ShouldBeInstance.

public static ErrorMessageFactory

Returns:

the created ErrorMessageFactory.
shouldBeInstanceButWasNull
(String
the description of the null object we wanted to check type.
objectDescription
,
Class<?>
the \nExpecting:\n type.
type
)

Creates a new ShouldBeInstance when object we want to check type is null.

Inherited from org.assertj.core.error.BasicErrorMessageFactory:
createcreatecreateequalshashCodetoStringunquotedString

Constructor Detail

ShouldBeInstanceback to summary
private ShouldBeInstance(Object object, Class<?> type)
ShouldBeInstanceback to summary
private ShouldBeInstance(Throwable throwable, Class<?> type)
ShouldBeInstanceback to summary
private ShouldBeInstance(String objectDescription, Class<?> type)

Method Detail

shouldBeInstanceback to summary
public static ErrorMessageFactory shouldBeInstance(Object object, Class<?> type)

Creates a new ShouldBeInstance.

Parameters
object:Object

the object value in the failed assertion.

type:Class<?>

the type object is \nExpecting:\n to belong to.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.

shouldBeInstanceButWasNullback to summary
public static ErrorMessageFactory shouldBeInstanceButWasNull(String objectDescription, Class<?> type)

Creates a new ShouldBeInstance when object we want to check type is null.

Parameters
objectDescription:String

the description of the null object we wanted to check type.

type:Class<?>

the \nExpecting:\n type.

Returns:ErrorMessageFactory

the created ErrorMessageFactory.