/** * Constructs and initializes an {@link RuntimeException} with the given {@link Throwable cause}, * {@link String message} and {@link Object arguments} used to format the message. * * @param cause {@link Throwable} identifying the reason the {@link RuntimeException} was thrown. * @param message {@link String} describing the {@link RuntimeException exception}. * @param args {@link Object arguments} used to replace format placeholders in the {@link String message}. * @return a new {@link RuntimeException} with the given {@link Throwable cause} and {@link String message}. * @see java.lang.RuntimeException */ public static RuntimeException newRuntimeException(Throwable cause, String message, Object... args) { return new RuntimeException(format(message, args), cause); }
/** * Constructs and initializes an {@link RuntimeException} with the given {@link Throwable cause}, * {@link String message} and {@link Object arguments} used to format the message. * * @param cause {@link Throwable} identifying the reason the {@link RuntimeException} was thrown. * @param message {@link String} describing the {@link RuntimeException exception}. * @param args array of {@link Object arguments} used to replace format placeholders in the {@link String message}. * @return a new {@link RuntimeException} with the given {@link Throwable cause} and {@link String message}. * @see java.lang.RuntimeException */ public static RuntimeException newRuntimeException(Throwable cause, String message, Object... args) { return new RuntimeException(format(message, args), cause); }
/** * Constructs and initializes an {@link IllegalArgumentException} with the given {@link Throwable cause}, * {@link String message} and {@link Object arguments} used to format the message. * * @param cause {@link Throwable} identifying the reason the {@link IllegalArgumentException} was thrown. * @param message {@link String} describing the {@link IllegalArgumentException exception}. * @param args {@link Object arguments} used to replace format placeholders in the {@link String message}. * @return a new {@link IllegalArgumentException} with the given {@link Throwable cause} and {@link String message}. * @see java.lang.IllegalArgumentException */ public static IllegalArgumentException newIllegalArgumentException(Throwable cause, String message, Object... args) { return new IllegalArgumentException(format(message, args), cause); }
/** * Constructs and initializes an {@link UnsupportedOperationException} with the given {@link Throwable cause}, * {@link String message} and {@link Object arguments} used to format the message. * * @param cause {@link Throwable} identifying the reason the {@link UnsupportedOperationException} was thrown. * @param message {@link String} describing the {@link UnsupportedOperationException exception}. * @param args array of {@link Object arguments} used to replace format placeholders in the {@link String message}. * @return a new {@link UnsupportedOperationException} with the given {@link Throwable cause} * and {@link String message}. * @see java.lang.UnsupportedOperationException */ public static UnsupportedOperationException newUnsupportedOperationException(Throwable cause, String message, Object... args) { return new UnsupportedOperationException(format(message, args), cause); }
/** * Constructs and initializes an {@link IllegalStateException} with the given {@link Throwable cause}, * {@link String message} and {@link Object arguments} used to format the message. * * @param cause {@link Throwable} identifying the reason the {@link IllegalStateException} was thrown. * @param message {@link String} describing the {@link IllegalStateException exception}. * @param args array of {@link Object arguments} used to replace format placeholders in the {@link String message}. * @return a new {@link IllegalStateException} with the given {@link Throwable cause} and {@link String message}. * @see java.lang.IllegalStateException */ public static IllegalStateException newIllegalStateException(Throwable cause, String message, Object... args) { return new IllegalStateException(format(message, args), cause); }
/** * Constructs and initializes an {@link IllegalStateException} with the given {@link Throwable cause}, * {@link String message} and {@link Object arguments} used to format the message. * * @param cause {@link Throwable} identifying the reason the {@link IllegalStateException} was thrown. * @param message {@link String} describing the {@link IllegalStateException exception}. * @param args {@link Object arguments} used to replace format placeholders in the {@link String message}. * @return a new {@link IllegalStateException} with the given {@link Throwable cause} and {@link String message}. * @see java.lang.IllegalStateException */ public static IllegalStateException newIllegalStateException(Throwable cause, String message, Object... args) { return new IllegalStateException(format(message, args), cause); }
/** * Constructs and initializes an {@link IllegalArgumentException} with the given {@link Throwable cause}, * {@link String message} and {@link Object arguments} used to format the message. * * @param cause {@link Throwable} identifying the reason the {@link IllegalArgumentException} was thrown. * @param message {@link String} describing the {@link IllegalArgumentException exception}. * @param args array of {@link Object arguments} used to replace format placeholders in the {@link String message}. * @return a new {@link IllegalArgumentException} with the given {@link Throwable cause} and {@link String message}. * @see java.lang.IllegalArgumentException */ public static IllegalArgumentException newIllegalArgumentException(Throwable cause, String message, Object... args) { return new IllegalArgumentException(format(message, args), cause); }
/** * Constructs and initializes an {@link UnsupportedOperationException} with the given {@link Throwable cause}, * {@link String message} and {@link Object arguments} used to format the message. * * @param cause {@link Throwable} identifying the reason the {@link UnsupportedOperationException} was thrown. * @param message {@link String} describing the {@link UnsupportedOperationException exception}. * @param args {@link Object arguments} used to replace format placeholders in the {@link String message}. * @return a new {@link UnsupportedOperationException} with the given {@link Throwable cause} * and {@link String message}. * @see java.lang.UnsupportedOperationException */ public static UnsupportedOperationException newUnsupportedOperationException(Throwable cause, String message, Object... args) { return new UnsupportedOperationException(format(message, args), cause); }