public class MethodInvocationFailResult extends java.lang.Object implements MethodInvocationResult
MethodInvocationResult
for failed
invocations (where a checked exception was thrown).Constructor and Description |
---|
MethodInvocationFailResult(java.lang.Throwable thrown) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getReturnValue()
The return value from the method invocation.
|
<T extends java.lang.Throwable> |
getThrown(java.lang.Class<T> throwableClass)
If
MethodInvocationResult.isFail() is true, this method provides access to the actual checked exception that was thrown. |
boolean |
isFail()
If true, then the method invocation ended with a checked exception being thrown.
|
void |
rethrow()
If the invocation threw a checked exception, this method will wrap that exception in a
RuntimeException and throw that.
|
public MethodInvocationFailResult(java.lang.Throwable thrown)
public java.lang.Object getReturnValue()
MethodInvocationResult
getReturnValue
in interface MethodInvocationResult
public <T extends java.lang.Throwable> T getThrown(java.lang.Class<T> throwableClass)
MethodInvocationResult
MethodInvocationResult.isFail()
is true, this method provides access to the actual checked exception that was thrown.getThrown
in interface MethodInvocationResult
throwableClass
- the type of exception to matchpublic boolean isFail()
MethodInvocationResult
isFail
in interface MethodInvocationResult
public void rethrow()
MethodInvocationResult
MethodInvocationResult.getReturnValue()
.rethrow
in interface MethodInvocationResult
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.