public class GraalError extends Error
| Constructor and Description |
|---|
GraalError(GraalError e)
|
GraalError(String msg)
This constructor creates a
GraalError with a given message. |
GraalError(String msg,
Object... args)
This constructor creates a
GraalError with a message assembled via
String.format(String, Object...). |
GraalError(Throwable cause)
This constructor creates a
GraalError for a given causing Throwable instance. |
GraalError(Throwable cause,
String msg,
Object... args)
This constructor creates a
GraalError for a given causing Throwable instance with
detailed error message. |
| Modifier and Type | Method and Description |
|---|---|
GraalError |
addContext(String newContext) |
GraalError |
addContext(String name,
Object obj) |
String |
context() |
static void |
guarantee(boolean condition,
String msg)
Checks a given condition and throws a
GraalError if it is false. |
static void |
guarantee(boolean condition,
String msg,
Object arg)
Checks a given condition and throws a
GraalError if it is false. |
static void |
guarantee(boolean condition,
String msg,
Object arg1,
Object arg2)
Checks a given condition and throws a
GraalError if it is false. |
static void |
guarantee(boolean condition,
String msg,
Object arg1,
Object arg2,
Object arg3)
Checks a given condition and throws a
GraalError if it is false. |
static void |
guarantee(boolean condition,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
Checks a given condition and throws a
GraalError if it is false. |
static RuntimeException |
shouldNotReachHere() |
static RuntimeException |
shouldNotReachHere(String msg) |
static RuntimeException |
shouldNotReachHere(Throwable cause) |
static RuntimeException |
shouldNotReachHere(Throwable cause,
String msg) |
String |
toString() |
static RuntimeException |
unimplemented() |
static RuntimeException |
unimplemented(String msg) |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTracepublic GraalError(String msg)
GraalError with a given message.msg - the message that will be associated with the errorpublic GraalError(String msg, Object... args)
GraalError with a message assembled via
String.format(String, Object...). It always uses the ENGLISH locale in order to
always generate the same output.msg - the message that will be associated with the error, in String.format syntaxargs - parameters to String.format - parameters that implement Iterable will be
expanded into a [x, x, ...] representation.public GraalError(Throwable cause)
GraalError for a given causing Throwable instance.cause - the original exception that contains additional information on this errorpublic GraalError(Throwable cause, String msg, Object... args)
GraalError for a given causing Throwable instance with
detailed error message.public GraalError(GraalError e)
e - the original GraalErrorpublic static RuntimeException unimplemented()
public static RuntimeException unimplemented(String msg)
public static RuntimeException shouldNotReachHere()
public static RuntimeException shouldNotReachHere(String msg)
public static RuntimeException shouldNotReachHere(Throwable cause)
public static RuntimeException shouldNotReachHere(Throwable cause, String msg)
public static void guarantee(boolean condition,
String msg)
GraalError if it is false. Guarantees are
stronger than assertions in that they are always checked. Error messages for guarantee
violations should clearly indicate the nature of the problem as well as a suggested solution
if possible.condition - the condition to checkmsg - the message that will be associated with the errorpublic static void guarantee(boolean condition,
String msg,
Object arg)
GraalError if it is false. Guarantees are
stronger than assertions in that they are always checked. Error messages for guarantee
violations should clearly indicate the nature of the problem as well as a suggested solution
if possible.condition - the condition to checkmsg - the message that will be associated with the error, in
String.format(String, Object...) syntaxarg - argument to the format string in msgpublic static void guarantee(boolean condition,
String msg,
Object arg1,
Object arg2)
GraalError if it is false. Guarantees are
stronger than assertions in that they are always checked. Error messages for guarantee
violations should clearly indicate the nature of the problem as well as a suggested solution
if possible.condition - the condition to checkmsg - the message that will be associated with the error, in
String.format(String, Object...) syntaxarg1 - argument to the format string in msgarg2 - argument to the format string in msgpublic static void guarantee(boolean condition,
String msg,
Object arg1,
Object arg2,
Object arg3)
GraalError if it is false. Guarantees are
stronger than assertions in that they are always checked. Error messages for guarantee
violations should clearly indicate the nature of the problem as well as a suggested solution
if possible.condition - the condition to checkmsg - the message that will be associated with the error, in
String.format(String, Object...) syntaxarg1 - argument to the format string in msgarg2 - argument to the format string in msgarg3 - argument to the format string in msgpublic static void guarantee(boolean condition,
String msg,
Object arg1,
Object arg2,
Object arg3,
Object arg4)
GraalError if it is false. Guarantees are
stronger than assertions in that they are always checked. Error messages for guarantee
violations should clearly indicate the nature of the problem as well as a suggested solution
if possible.condition - the condition to checkmsg - the message that will be associated with the error, in
String.format(String, Object...) syntaxarg1 - argument to the format string in msgarg2 - argument to the format string in msgarg3 - argument to the format string in msgarg4 - argument to the format string in msgpublic String context()
public GraalError addContext(String newContext)
public GraalError addContext(String name, Object obj)