org.fest.assertions.api
Class ObjectAssert

java.lang.Object
  extended by org.fest.assertions.api.AbstractAssert<ObjectAssert,Object>
      extended by org.fest.assertions.api.ObjectAssert
All Implemented Interfaces:
Assert<ObjectAssert,Object>, Descriptable<ObjectAssert>, ExtensionPoints<ObjectAssert,Object>

public class ObjectAssert
extends AbstractAssert<ObjectAssert,Object>

Assertion methods for Objects.

To create a new instance of this class, invoke Assertions.assertThat(Object).

Author:
Yvonne Wang, Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.assertions.api.AbstractAssert
actual, myself
 
Constructor Summary
protected ObjectAssert(Object actual)
           
 
Method Summary
 ObjectAssert isInstanceOf(Class<?> type)
          Verifies that the actual Object is an instance of the given type.
 ObjectAssert isInstanceOfAny(Class<?>... types)
          Verifies that the actual Object is an instance of any of the given types.
 
Methods inherited from class org.fest.assertions.api.AbstractAssert
as, as, describedAs, describedAs, descriptionText, doesNotHave, equals, has, hashCode, is, isEqualTo, isIn, isIn, isNot, isNotEqualTo, isNotIn, isNotIn, isNotNull, isNotSameAs, isNull, isSameAs, usingComparator, usingDefaultComparator
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectAssert

protected ObjectAssert(Object actual)
Method Detail

isInstanceOf

public ObjectAssert isInstanceOf(Class<?> type)
Verifies that the actual Object is an instance of the given type.

Parameters:
type - the type to check the actual Object against.
Returns:
this assertion object.
Throws:
NullPointerException - if the given type is null.
AssertionError - if the actual Object is null.
AssertionError - if the actual Object is not an instance of the given type.

isInstanceOfAny

public ObjectAssert isInstanceOfAny(Class<?>... types)
Verifies that the actual Object is an instance of any of the given types.

Parameters:
types - the types to check the actual Object against.
Returns:
this assertion object.
Throws:
AssertionError - if the actual Object is null.
AssertionError - if the actual Object is not an instance of any of the given types.
NullPointerException - if the given array of types is null.
NullPointerException - if the given array of types contains nulls.


Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.