org.assertj.core.internal
Class Classes

java.lang.Object
  extended by org.assertj.core.internal.Classes

public class Classes
extends Object

Reusable assertions for Classs.

Author:
William Delanoue

Constructor Summary
Classes()
           
 
Method Summary
 void assertContainsAnnotations(AssertionInfo info, Class<?> actual, Class<? extends Annotation>... annotations)
          Verifies that the actual Class contains the given Annotations.
 void assertHasDeclaredFields(AssertionInfo info, Class<?> actual, String... fields)
          Verifies that the actual Class has the declared fields.
 void assertHasFields(AssertionInfo info, Class<?> actual, String... fields)
          Verifies that the actual Class has the fields.
 void assertIsAnnotation(AssertionInfo info, Class<?> actual)
          Verifies that the actual Class is an annotation.
 void assertIsAssignableFrom(AssertionInfo info, Class<?> actual, Class<?>... others)
          Verifies that the actual Class is assignable from all the others classes.
 void assertIsInterface(AssertionInfo info, Class<?> actual)
          Verifies that the actual Class is an interface.
 void assertIsNotAnnotation(AssertionInfo info, Class<?> actual)
          Verifies that the actual Class is not an annotation.
 void assertIsNotInterface(AssertionInfo info, Class<?> actual)
          Verifies that the actual Class is not an interface.
static Classes instance()
          Returns the singleton instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Classes

public Classes()
Method Detail

instance

public static Classes instance()
Returns the singleton instance of this class.

Returns:
the singleton instance of this class.

assertIsAssignableFrom

public void assertIsAssignableFrom(AssertionInfo info,
                                   Class<?> actual,
                                   Class<?>... others)
Verifies that the actual Class is assignable from all the others classes.

Parameters:
info - contains information about the assertion.
actual - the "actual" Class.
others - the others Class who this actual class must be assignable.
Throws:
NullPointerException - if one of the others is null.
AssertionError - if actual is null.
AssertionError - if the actual Class is not assignable from all of the others classes.

assertIsNotInterface

public void assertIsNotInterface(AssertionInfo info,
                                 Class<?> actual)
Verifies that the actual Class is not an interface.

Parameters:
info - contains information about the assertion.
actual - the "actual" Class.
Throws:
AssertionError - if actual is null.
AssertionError - if the actual Class is an interface.

assertIsInterface

public void assertIsInterface(AssertionInfo info,
                              Class<?> actual)
Verifies that the actual Class is an interface.

Parameters:
info - contains information about the assertion.
actual - the "actual" Class.
Throws:
AssertionError - if actual is null.
AssertionError - if the actual Class is not an interface.

assertIsNotAnnotation

public void assertIsNotAnnotation(AssertionInfo info,
                                  Class<?> actual)
Verifies that the actual Class is not an annotation.

Parameters:
info - contains information about the assertion.
actual - the "actual" Class.
Throws:
AssertionError - if actual is null.
AssertionError - if the actual Class is an annotation.

assertIsAnnotation

public void assertIsAnnotation(AssertionInfo info,
                               Class<?> actual)
Verifies that the actual Class is an annotation.

Parameters:
info - contains information about the assertion.
actual - the "actual" Class.
Throws:
AssertionError - if actual is null.
AssertionError - if the actual Class is not an annotation.

assertContainsAnnotations

public void assertContainsAnnotations(AssertionInfo info,
                                      Class<?> actual,
                                      Class<? extends Annotation>... annotations)
Verifies that the actual Class contains the given Annotations.

Parameters:
info - contains information about the assertion.
actual - the "actual" Class.
annotations - annotations who must be attached to the class
Throws:
AssertionError - if actual is null.
AssertionError - if the actual Class doesn't contains all of these annotations.

assertHasFields

public void assertHasFields(AssertionInfo info,
                            Class<?> actual,
                            String... fields)
Verifies that the actual Class has the fields.

Parameters:
info - contains information about the assertion.
actual - the "actual" Class.
fields - the fields who must be present in the class.
Throws:
AssertionError - if actual is null.
AssertionError - if the actual Class doesn't contains all of the field.

assertHasDeclaredFields

public void assertHasDeclaredFields(AssertionInfo info,
                                    Class<?> actual,
                                    String... fields)
Verifies that the actual Class has the declared fields.

Parameters:
info - contains information about the assertion.
actual - the "actual" Class.
fields - the fields who must be declared in the class.
Throws:
AssertionError - if actual is null.
AssertionError - if the actual Class doesn't contains all of the field.


Copyright © 2013–2015 AssertJ. All rights reserved.