org.assertj.core.error
Class ShouldBeInstance

java.lang.Object
  extended by org.assertj.core.error.BasicErrorMessageFactory
      extended by 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.

Author:
Alex Ruiz, Joel Costigliola

Field Summary
 
Fields inherited from class org.assertj.core.error.BasicErrorMessageFactory
arguments, format
 
Method Summary
static ErrorMessageFactory shouldBeInstance(Object object, Class<?> type)
          Creates a new ShouldBeInstance.
static ErrorMessageFactory shouldBeInstanceButWasNull(String objectDescription, Class<?> type)
          Creates a new ShouldBeInstance when object we want to check type is null.
 
Methods inherited from class org.assertj.core.error.BasicErrorMessageFactory
create, create, equals, hashCode, toString, unquotedString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

shouldBeInstance

public static ErrorMessageFactory shouldBeInstance(Object object,
                                                   Class<?> type)
Creates a new ShouldBeInstance.

Parameters:
object - the object value in the failed assertion.
type - the type object is \nExpecting:\n to belong to.
Returns:
the created ErrorMessageFactory.

shouldBeInstanceButWasNull

public static ErrorMessageFactory shouldBeInstanceButWasNull(String objectDescription,
                                                             Class<?> type)
Creates a new ShouldBeInstance 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.


Copyright © 2013–2015 AssertJ. All rights reserved.