public class Exceptions extends Object
Utility methods for creating IllegalStateException's
and IllegaArgumentException's
with richly formatted error messages.
throw Exceptions.illegalArgument("port must be >= %s and <= %s", 0, 65535);
Constructor and Description |
---|
Exceptions() |
Modifier and Type | Method and Description |
---|---|
protected static String |
formattedMessage(String msg,
Object... args) |
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) |
public Exceptions()
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)
protected static String formattedMessage(String msg, Object... args)
Copyright © 2010–2014 The Kuali Foundation. All rights reserved.