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 section 15.18.1.1 of The Java™ Language Specification), 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 section 15.18.1.1 of The Java™ Language Specification.

    If the specified object is an instance of {@code 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) 
 public AssertionError(String message,
    Throwable cause) 
    Constructs a new {@code AssertionError} with the specified detail message and cause.

    Note that the detail message associated with {@code cause} is not automatically incorporated in this error's detail message.

    Parameters:
    message - the detail message, may be {@code null}
    cause - the cause, may be {@code null}
    since: 1.7 -
Methods from java.lang.Throwable:
addSuppressed,   fillInStackTrace,   getCause,   getLocalizedMessage,   getMessage,   getStackTrace,   getStackTraceDepth,   getStackTraceElement,   getSuppressed,   initCause,   printStackTrace,   printStackTrace,   printStackTrace,   setStackTrace,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait