public final class Exceptions extends Object
Modifier and Type | Method and Description |
---|---|
static ArithmeticException |
newArithmeticExceptionWithCause(String message,
Exception cause)
|
static ArithmeticException |
newRoundingNecessaryArithmeticException()
Returns new
ArithmeticException indicating that rounding was
necessary when attempting to apply rounding with
RoundingMode.UNNECESSARY . |
static void |
rethrowIfRoundingNecessary(ArithmeticException e)
Rethrows the given arithmetic exception if its message equals
"Rounding necessary".
|
public static final ArithmeticException newArithmeticExceptionWithCause(String message, Exception cause)
message
- the exception messagecause
- the causing exceptionpublic static final ArithmeticException newRoundingNecessaryArithmeticException()
ArithmeticException
indicating that rounding was
necessary when attempting to apply rounding with
RoundingMode.UNNECESSARY
.public static final void rethrowIfRoundingNecessary(ArithmeticException e)
e
- the exception to rethrow if it is of the "Rounding necessary"
typeArithmeticException
- rethrows the given exception e
if its message equals
"Rounding necessary"