Save This Page
Home » openjdk-7 » java » lang » [javadoc | source]
java.lang
public class: AssertionError [javadoc | source]
java.lang.Object
   java.lang.Throwable
      java.lang.Error
         java.lang.AssertionError

All Implemented Interfaces:
    Serializable

Thrown to indicate that an assertion has failed.

The seven one-argument public constructors provided by this class ensure that the assertion error returned by the invocation:

new AssertionError(expression)
has as its detail message the string conversion of expression (as defined in The Java Language Specification, Second Edition, Section 15.18.1.1), regardless of the type of expression.
Fields inherited from java.lang.Error:
serialVersionUID
Constructor:
 public AssertionError() 
 public AssertionError(Object detailMessage) 
    Constructs an AssertionError with its detail message derived from the specified object, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.

    If the specified object is an instance of Throwable, it becomes the cause of the newly constructed assertion error.

    Parameters:
    detailMessage - value to be used in constructing detail message
    Also see:
    Throwable#getCause()
 public AssertionError(boolean detailMessage) 
 public AssertionError(char detailMessage) 
 public AssertionError(int detailMessage) 
 public AssertionError(long detailMessage) 
 public AssertionError(float detailMessage) 
 public AssertionError(double detailMessage) 
Methods from java.lang.Throwable:
fillInStackTrace,   getCause,   getLocalizedMessage,   getMessage,   getStackTrace,   initCause,   printStackTrace,   printStackTrace,   printStackTrace,   setStackTrace,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait