Package java.lang
Class AssertionError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Error
-
- java.lang.AssertionError
-
- All Implemented Interfaces:
Serializable
public class AssertionError extends Error
Thrown when an assertion has failed.- Since:
- 1.4
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AssertionError()Constructs a newAssertionErrorwith no message.AssertionError(boolean detailMessage)Constructs a newAssertionErrorwith a message based on callingString.valueOf(boolean)with the specified boolean value.AssertionError(char detailMessage)Constructs a newAssertionErrorwith a message based on callingString.valueOf(char)with the specified character value.AssertionError(double detailMessage)Constructs a newAssertionErrorwith a message based on callingString.valueOf(double)with the specified double value.AssertionError(float detailMessage)Constructs a newAssertionErrorwith a message based on callingString.valueOf(float)with the specified float value.AssertionError(int detailMessage)Constructs a newAssertionErrorwith a message based on callingString.valueOf(int)with the specified integer value.AssertionError(long detailMessage)Constructs a newAssertionErrorwith a message based on callingString.valueOf(long)with the specified long value.AssertionError(Object detailMessage)Constructs a newAssertionErrorwith a message based on callingString.valueOf(Object)with the specified object.AssertionError(String detailMessage, Throwable cause)Constructs a newAssertionErrorwith the given detail message and cause.
-
Method Summary
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
AssertionError
public AssertionError()
Constructs a newAssertionErrorwith no message.
-
AssertionError
public AssertionError(String detailMessage, Throwable cause)
Constructs a newAssertionErrorwith the given detail message and cause.- Since:
- 1.7
-
AssertionError
public AssertionError(Object detailMessage)
Constructs a newAssertionErrorwith a message based on callingString.valueOf(Object)with the specified object. If the object is an instance ofThrowable, then it also becomes the cause of this error.- Parameters:
detailMessage- the object to be converted into the detail message and optionally the cause.
-
AssertionError
public AssertionError(boolean detailMessage)
Constructs a newAssertionErrorwith a message based on callingString.valueOf(boolean)with the specified boolean value.- Parameters:
detailMessage- the value to be converted into the message.
-
AssertionError
public AssertionError(char detailMessage)
Constructs a newAssertionErrorwith a message based on callingString.valueOf(char)with the specified character value.- Parameters:
detailMessage- the value to be converted into the message.
-
AssertionError
public AssertionError(int detailMessage)
Constructs a newAssertionErrorwith a message based on callingString.valueOf(int)with the specified integer value.- Parameters:
detailMessage- the value to be converted into the message.
-
AssertionError
public AssertionError(long detailMessage)
Constructs a newAssertionErrorwith a message based on callingString.valueOf(long)with the specified long value.- Parameters:
detailMessage- the value to be converted into the message.
-
AssertionError
public AssertionError(float detailMessage)
Constructs a newAssertionErrorwith a message based on callingString.valueOf(float)with the specified float value.- Parameters:
detailMessage- the value to be converted into the message.
-
AssertionError
public AssertionError(double detailMessage)
Constructs a newAssertionErrorwith a message based on callingString.valueOf(double)with the specified double value.- Parameters:
detailMessage- the value to be converted into the message.
-
-