public class MultiException
extends java.lang.Exception
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
DEFAULT_MESSAGE |
private java.util.List<java.lang.Throwable> |
nested |
Modifier | Constructor and Description |
---|---|
|
MultiException() |
private |
MultiException(java.util.List<java.lang.Throwable> nested)
Create a MultiException which may be thrown.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Throwable e) |
java.lang.Throwable |
getThrowable(int i) |
java.util.List<java.lang.Throwable> |
getThrowables() |
void |
ifExceptionThrow()
Throw a multiexception.
|
void |
ifExceptionThrowMulti()
Throw a multiexception.
|
void |
ifExceptionThrowRuntime()
Throw a Runtime exception.
|
void |
ifExceptionThrowSuppressed()
Throw an Exception, potentially with suppress.
|
int |
size() |
java.lang.String |
toString() |
private static final java.lang.String DEFAULT_MESSAGE
private java.util.List<java.lang.Throwable> nested
public MultiException()
private MultiException(java.util.List<java.lang.Throwable> nested)
nested
- The nested exceptions which will be suppressed by this
exception.public void add(java.lang.Throwable e)
public int size()
public java.util.List<java.lang.Throwable> getThrowables()
public java.lang.Throwable getThrowable(int i)
public void ifExceptionThrow() throws java.lang.Exception
java.lang.Exception
- the Error or Exception if nested is 1, or the MultiException itself if nested is more than 1.public void ifExceptionThrowRuntime() throws java.lang.Error
java.lang.Error
- If this exception contains exactly 1 Error
java.lang.RuntimeException
- If this exception contains 1 Throwable
but it is not an error,
or it contains more than 1 Throwable
of any type.public void ifExceptionThrowMulti() throws MultiException
MultiException
- the multiexception if there are nested exceptionpublic void ifExceptionThrowSuppressed() throws java.lang.Exception
java.lang.Exception
- the Error or Exception if at least one is added.public java.lang.String toString()
toString
in class java.lang.Throwable