public class IOExceptionList extends IOException implements Iterable<Throwable>
The first exception in the list is used as this exception's cause and is accessible with the usual
Throwable.getCause()
while the complete list is accessible with getCauseList()
.
Constructor and Description |
---|
IOExceptionList(List<? extends Throwable> causeList)
Creates a new exception caused by a list of exceptions.
|
IOExceptionList(String message,
List<? extends Throwable> causeList)
Creates a new exception caused by a list of exceptions.
|
Modifier and Type | Method and Description |
---|---|
static void |
checkEmpty(List<? extends Throwable> causeList,
Object message)
Throws this exception if the list is not null or empty.
|
<T extends Throwable> |
getCause(int index)
Gets the cause exception at the given index.
|
<T extends Throwable> |
getCause(int index,
Class<T> clazz)
Gets the cause exception at the given index.
|
<T extends Throwable> |
getCauseList()
Gets the cause list.
|
<T extends Throwable> |
getCauseList(Class<T> clazz)
Works around Throwable and Generics, may fail at runtime depending on the argument value.
|
Iterator<Throwable> |
iterator() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public IOExceptionList(List<? extends Throwable> causeList)
causeList
- a list of cause exceptions.public IOExceptionList(String message, List<? extends Throwable> causeList)
message
- The detail message, see Throwable.getMessage()
.causeList
- a list of cause exceptions.public static void checkEmpty(List<? extends Throwable> causeList, Object message) throws IOExceptionList
causeList
- The list to test.message
- The detail message, see Throwable.getMessage()
.IOExceptionList
- if the list is not null or empty.public <T extends Throwable> T getCause(int index)
T
- type of exception to return.index
- index in the cause list.public <T extends Throwable> T getCause(int index, Class<T> clazz)
T
- type of exception to return.index
- index in the cause list.clazz
- type of exception to return.public <T extends Throwable> List<T> getCauseList()
T
- type of exception to return.public <T extends Throwable> List<T> getCauseList(Class<T> clazz)
T
- type of exception to return.clazz
- the target typeCopyright © 2002–2023 The Apache Software Foundation. All rights reserved.