|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.omnaest.utils.structure.element.ExceptionHandledResult<E>
E - public class ExceptionHandledResult<E>
An ExceptionHandledResult is the result of an operation which catches Exceptions and does not throw them.
The getResult() will return potential value.
| Field Summary | |
|---|---|
protected List<Exception> |
exceptionList
|
protected E |
result
|
| Constructor Summary | |
|---|---|
ExceptionHandledResult(E result,
Collection<Exception> exceptionCollection)
|
|
| Method Summary | |
|---|---|
boolean |
containsAssignableException(Class<? extends Exception> exceptionType)
Returns true if the ExceptionHandledResult contains any exception which could be assigned to the given Class
of Exception |
List<Exception> |
getExceptionList()
Returns the List of all catched Exceptions |
Exception |
getFirstException()
Returns the first Exception if any Exception is present |
E |
getResult()
Returns the resulting element |
boolean |
hasExceptions()
Returns true if any Exceptions have been catched |
boolean |
hasNoExceptions()
Returns true, if no Exceptions have been catched |
boolean |
hasResult()
Returns true if getResult() is not null |
Exception |
resolveAssignableException(Class<? extends Exception> exceptionType)
Resolves the first occurring stored Exception which can be assigned to the given Class type. |
void |
rethrowFirstExceptionAssignableToTypeIfAnyExceptionHasOccurred(Class<? extends Exception> exceptionType)
Throws the first occurring Exception which is assignable to the given Class again. |
void |
rethrowFirstExceptionIfAnyExceptionHasOccurred()
Throws the first Exception again if hasExceptions() is true which shows that at least one Exception
has occurred. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected E result
protected List<Exception> exceptionList
| Constructor Detail |
|---|
public ExceptionHandledResult(E result,
Collection<Exception> exceptionCollection)
result - exceptionCollection - | Method Detail |
|---|
public E getResult()
public boolean hasResult()
getResult() is not null
public List<Exception> getExceptionList()
List of all catched Exceptions
public boolean hasNoExceptions()
Exceptions have been catched
public boolean hasExceptions()
Exceptions have been catched
public boolean containsAssignableException(Class<? extends Exception> exceptionType)
ExceptionHandledResult contains any exception which could be assigned to the given Class
of Exception
exceptionType -
public Exception resolveAssignableException(Class<? extends Exception> exceptionType)
Exception which can be assigned to the given Class type. This includes
the causes of stored Exceptions.
exceptionType -
containsAssignableException(Class)
public void rethrowFirstExceptionIfAnyExceptionHasOccurred()
throws Exception
Exception again if hasExceptions() is true which shows that at least one Exception
has occurred.
Exception
public void rethrowFirstExceptionAssignableToTypeIfAnyExceptionHasOccurred(Class<? extends Exception> exceptionType)
throws Exception
Exception which is assignable to the given Class again. If no Exception
are present or match nothing will happen.
ExceptionresolveAssignableException(Class)public Exception getFirstException()
Exception if any Exception is present
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||