public final class Exceptions extends Object
Utility methods for creating exceptions with richly formatted error messages.
Utility method for generating the stacktrace of an exception as a string.
Example usage:
throw Exceptions.illegalArgument("port must be >= %s and <= %s", 0, 65535);
| Constructor and Description |
|---|
Exceptions() |
| Modifier and Type | Method and Description |
|---|---|
static IllegalArgumentException |
illegalArgument(String msg) |
static IllegalArgumentException |
illegalArgument(String msg,
Object... args) |
static IllegalArgumentException |
illegalArgument(Throwable cause) |
static IllegalArgumentException |
illegalArgument(Throwable cause,
String msg,
Object... args) |
static IllegalStateException |
illegalState(String msg) |
static IllegalStateException |
illegalState(String msg,
Object... args) |
static IllegalStateException |
illegalState(Throwable cause) |
static IllegalStateException |
illegalState(Throwable cause,
String msg,
Object... args) |
static IOException |
newIOException(String msg) |
static IOException |
newIOException(String msg,
Object... args) |
static IOException |
newIOException(Throwable cause) |
static IOException |
newIOException(Throwable cause,
String msg,
Object... args) |
static String |
printStackTraceToString(Throwable throwable) |
public Exceptions()
public static String printStackTraceToString(Throwable throwable)
public static IOException newIOException(Throwable cause)
public static IOException newIOException(String msg)
public static IOException newIOException(String msg, Object... args)
public static IOException newIOException(Throwable cause, String msg, Object... args)
public static IllegalStateException illegalState(Throwable cause)
public static IllegalStateException illegalState(String msg)
public static IllegalStateException illegalState(String msg, Object... args)
public static IllegalStateException illegalState(Throwable cause, String msg, Object... args)
public static IllegalArgumentException illegalArgument(Throwable cause)
public static IllegalArgumentException illegalArgument(String msg)
public static IllegalArgumentException illegalArgument(String msg, Object... args)
public static IllegalArgumentException illegalArgument(Throwable cause, String msg, Object... args)
Copyright © 2010–2014 The Kuali Foundation. All rights reserved.