Package java.lang

Class AssertionError

All Implemented Interfaces:
Serializable

public class AssertionError
extends Error
Thrown when an assertion has failed.
Since:
1.4
See Also:
Serialized Form
  • Constructor Details

    • AssertionError

      public AssertionError()
      Constructs a new AssertionError with no message.
    • AssertionError

      public AssertionError​(String detailMessage, Throwable cause)
      Constructs a new AssertionError with the given detail message and cause.
      Since:
      1.7
    • AssertionError

      public AssertionError​(Object detailMessage)
      Constructs a new AssertionError with a message based on calling String.valueOf(Object) with the specified object. If the object is an instance of Throwable, 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 new AssertionError with a message based on calling String.valueOf(boolean) with the specified boolean value.
      Parameters:
      detailMessage - the value to be converted into the message.
    • AssertionError

      public AssertionError​(char detailMessage)
      Constructs a new AssertionError with a message based on calling String.valueOf(char) with the specified character value.
      Parameters:
      detailMessage - the value to be converted into the message.
    • AssertionError

      public AssertionError​(int detailMessage)
      Constructs a new AssertionError with a message based on calling String.valueOf(int) with the specified integer value.
      Parameters:
      detailMessage - the value to be converted into the message.
    • AssertionError

      public AssertionError​(long detailMessage)
      Constructs a new AssertionError with a message based on calling String.valueOf(long) with the specified long value.
      Parameters:
      detailMessage - the value to be converted into the message.
    • AssertionError

      public AssertionError​(float detailMessage)
      Constructs a new AssertionError with a message based on calling String.valueOf(float) with the specified float value.
      Parameters:
      detailMessage - the value to be converted into the message.
    • AssertionError

      public AssertionError​(double detailMessage)
      Constructs a new AssertionError with a message based on calling String.valueOf(double) with the specified double value.
      Parameters:
      detailMessage - the value to be converted into the message.