public abstract class RuntimeExceptionFactory extends Object
RuntimeExceptionFactory class is a factory for creating common RuntimeExceptions
with the added convenience of message formatting and optional causes.RuntimeException| Modifier and Type | Field and Description |
|---|---|
static String |
NOT_IMPLEMENTED |
static String |
NOT_SUPPORTED |
| Constructor and Description |
|---|
RuntimeExceptionFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected static String |
format(String message,
Object... args)
|
static IllegalArgumentException |
newIllegalArgumentException(String message,
Object... args)
Constructs and initializes an
IllegalArgumentException with the given message
and arguments used to format the message. |
static IllegalArgumentException |
newIllegalArgumentException(Throwable cause,
String message,
Object... args)
Constructs and initializes an
IllegalArgumentException with the given cause,
message and arguments used to format the message. |
static IllegalStateException |
newIllegalStateException(String message,
Object... args)
Constructs and initializes an
IllegalStateException with the given message
and arguments used to format the message. |
static IllegalStateException |
newIllegalStateException(Throwable cause,
String message,
Object... args)
Constructs and initializes an
IllegalStateException with the given cause,
message and arguments used to format the message. |
static RuntimeException |
newRuntimeException(String message,
Object... args)
Constructs and initializes an
RuntimeException with the given message
and arguments used to format the message. |
static RuntimeException |
newRuntimeException(Throwable cause,
String message,
Object... args)
Constructs and initializes an
RuntimeException with the given cause,
message and arguments used to format the message. |
static UnsupportedOperationException |
newUnsupportedOperationException(String message,
Object... args)
Constructs and initializes an
UnsupportedOperationException with the given message
and arguments used to format the message. |
static UnsupportedOperationException |
newUnsupportedOperationException(Throwable cause,
String message,
Object... args)
Constructs and initializes an
UnsupportedOperationException with the given cause,
message and arguments used to format the message. |
public static final String NOT_IMPLEMENTED
public static final String NOT_SUPPORTED
public static IllegalArgumentException newIllegalArgumentException(String message, Object... args)
IllegalArgumentException with the given message
and arguments used to format the message.message - String describing the exception.args - arguments used to replace format placeholders in the message.IllegalArgumentException with the given message.newIllegalArgumentException(Throwable, String, Object...),
IllegalArgumentExceptionpublic static IllegalArgumentException newIllegalArgumentException(Throwable cause, String message, Object... args)
IllegalArgumentException with the given cause,
message and arguments used to format the message.cause - Throwable identifying the reason the IllegalArgumentException was thrown.message - String describing the exception.args - arguments used to replace format placeholders in the message.IllegalArgumentException with the given cause and message.IllegalArgumentExceptionpublic static IllegalStateException newIllegalStateException(String message, Object... args)
IllegalStateException with the given message
and arguments used to format the message.message - String describing the exception.args - arguments used to replace format placeholders in the message.IllegalStateException with the given message.newIllegalStateException(Throwable, String, Object...),
IllegalStateExceptionpublic static IllegalStateException newIllegalStateException(Throwable cause, String message, Object... args)
IllegalStateException with the given cause,
message and arguments used to format the message.cause - Throwable identifying the reason the IllegalStateException was thrown.message - String describing the exception.args - arguments used to replace format placeholders in the message.IllegalStateException with the given cause and message.IllegalStateExceptionpublic static RuntimeException newRuntimeException(String message, Object... args)
RuntimeException with the given message
and arguments used to format the message.message - String describing the exception.args - arguments used to replace format placeholders in the message.RuntimeException with the given message.newRuntimeException(Throwable, String, Object...),
RuntimeExceptionpublic static RuntimeException newRuntimeException(Throwable cause, String message, Object... args)
RuntimeException with the given cause,
message and arguments used to format the message.cause - Throwable identifying the reason the RuntimeException was thrown.message - String describing the exception.args - arguments used to replace format placeholders in the message.RuntimeException with the given cause and message.RuntimeExceptionpublic static UnsupportedOperationException newUnsupportedOperationException(String message, Object... args)
UnsupportedOperationException with the given message
and arguments used to format the message.message - String describing the exception.args - arguments used to replace format placeholders in the messageUnsupportedOperationException with the given message.newUnsupportedOperationException(Throwable, String, Object...),
UnsupportedOperationExceptionpublic static UnsupportedOperationException newUnsupportedOperationException(Throwable cause, String message, Object... args)
UnsupportedOperationException with the given cause,
message and arguments used to format the message.cause - Throwable identifying the reason the UnsupportedOperationException was thrown.message - String describing the exception.args - arguments used to replace format placeholders in the message.UnsupportedOperationException with the given cause
and message.UnsupportedOperationExceptionprotected static String format(String message, Object... args)
message - String containing the message pattern to format.args - arguments used in the message to replace format placeholders.message.String.format(String, Object...),
MessageFormat.format(String, Object...)Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.