public class ResolvingException extends RuntimeException implements RResponse
Can be used as a return value to indicate non-critical exceptions.
However, in most cases it will be more efficient to
obtain a ResponseBuilder.
| Constructor and Description |
|---|
ResolvingException() |
ResolvingException(RRequest request) |
ResolvingException(RRequest request,
String message) |
ResolvingException(RRequest request,
String message,
Throwable cause) |
ResolvingException(RRequest request,
Throwable cause) |
ResolvingException(String message) |
ResolvingException(String message,
Throwable cause) |
ResolvingException(Throwable cause) |
| Modifier and Type | Method and Description |
|---|---|
<T1 extends Throwable> |
againAs(Class<T1> t1)
Throws the cause if it is the
specified type, otherwise returns a
runtime exception.
|
<T1 extends Throwable,T2 extends Throwable> |
againAs(Class<T1> t1,
Class<T2> t2)
Throws the cause if it is one of the
specified types, otherwise returns a
runtime exception.
|
<T1 extends Throwable,T2 extends Throwable,T3 extends Throwable> |
againAs(Class<T1> t1,
Class<T2> t2,
Class<T3> t3)
Throws the cause if it is one of the
specified types, otherwise returns a
runtime exception.
|
<T1 extends Throwable,T2 extends Throwable,T3 extends Throwable,T4 extends Throwable> |
againAs(Class<T1> t1,
Class<T2> t2,
Class<T3> t3,
Class<T4> t4)
Throws the cause if it is one of the
specified types, otherwise returns a
runtime exception.
|
ResolvingException |
asException()
Represents the warnings as single exception.
|
RuntimeException |
asRuntimeException()
If the cause is a RuntimeException,
returns the cause, otherwise returns this.
|
RRequest |
getRequest()
Returns the request that was responded to.
|
Throwable |
getResolvingCause()
Returns the underlying cause of this resolving exceptions.
|
RResult |
getResult()
Returns result if present, otherwise throws
RResponse.asException(). |
List<Exception> |
getWarningsLog()
Returns a list of non-critical exceptions that occurred during look-up.
|
boolean |
hasResult()
Returns true if look-up found a result.
|
<T1 extends Throwable> |
throwIf(Class<T1> t1)
Throws the cause if it is the
specified type, otherwise returns a
runtime exception.
|
<T1 extends Throwable,T2 extends Throwable> |
throwIf(Class<T1> t1,
Class<T2> t2)
Throws the cause if it is one of the
specified types, otherwise returns a
runtime exception.
|
<T1 extends Throwable,T2 extends Throwable,T3 extends Throwable> |
throwIf(Class<T1> t1,
Class<T2> t2,
Class<T3> t3)
Throws the cause if it is one of the
specified types, otherwise returns a
runtime exception.
|
<T1 extends Throwable,T2 extends Throwable,T3 extends Throwable,T4 extends Throwable> |
throwIf(Class<T1> t1,
Class<T2> t2,
Class<T3> t3,
Class<T4> t4)
Throws the cause if it is one of the
specified types, otherwise returns a
runtime exception.
|
static ResolvingException |
wrap(Exception e)
Wraps e in an resolving exception, if it isn't one already.
|
static ResolvingException |
wrap(RRequest request,
Exception e)
Wraps e in an resolving exception, if it isn't one already.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic ResolvingException()
public ResolvingException(String message)
public ResolvingException(Throwable cause)
public ResolvingException(RRequest request)
public static ResolvingException wrap(Exception e)
e - public static ResolvingException wrap(RRequest request, Exception e)
request - e - public RRequest getRequest()
RResponsegetRequest in interface RResponsepublic boolean hasResult()
RResponsepublic RResult getResult()
RResponseRResponse.asException().public ResolvingException asException()
RResponseasException in interface RResponsepublic List<Exception> getWarningsLog()
RResponsegetWarningsLog in interface RResponsepublic RuntimeException asRuntimeException()
public <T1 extends Throwable> RuntimeException againAs(Class<T1> t1) throws T1 extends Throwable
Intended to be written as throw e.againAs(IOException.class).
T1 - t1 - T1T1 extends Throwablepublic <T1 extends Throwable,T2 extends Throwable> RuntimeException againAs(Class<T1> t1, Class<T2> t2) throws T1 extends Throwable, T2 extends Throwable
Intended to be written as throw e.againAs(IOException.class).
T1 - T2 - t1 - t2 - T1T2T1 extends Throwablepublic <T1 extends Throwable,T2 extends Throwable,T3 extends Throwable> RuntimeException againAs(Class<T1> t1, Class<T2> t2, Class<T3> t3) throws T1 extends Throwable, T2 extends Throwable, T3 extends Throwable
Intended to be written as throw e.againAs(IOException.class).
T1 - T2 - T3 - t1 - t2 - t3 - T1T2T3T1 extends Throwablepublic <T1 extends Throwable,T2 extends Throwable,T3 extends Throwable,T4 extends Throwable> RuntimeException againAs(Class<T1> t1, Class<T2> t2, Class<T3> t3, Class<T4> t4) throws T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable
Intended to be written as throw e.againAs(IOException.class).
T1 - T2 - T3 - T4 - t1 - t2 - t3 - t4 - T1T2T3T4T1 extends Throwablepublic <T1 extends Throwable> RuntimeException throwIf(Class<T1> t1) throws T1 extends Throwable
T1 - t1 - T1T1 extends Throwablepublic <T1 extends Throwable,T2 extends Throwable> RuntimeException throwIf(Class<T1> t1, Class<T2> t2) throws T1 extends Throwable, T2 extends Throwable
T1 - T2 - t1 - t2 - T1T2T1 extends Throwablepublic <T1 extends Throwable,T2 extends Throwable,T3 extends Throwable> RuntimeException throwIf(Class<T1> t1, Class<T2> t2, Class<T3> t3) throws T1 extends Throwable, T2 extends Throwable, T3 extends Throwable
T1 - T2 - T3 - t1 - t2 - t3 - T1T2T3T1 extends Throwablepublic <T1 extends Throwable,T2 extends Throwable,T3 extends Throwable,T4 extends Throwable> RuntimeException throwIf(Class<T1> t1, Class<T2> t2, Class<T3> t3, Class<T4> t4) throws T1 extends Throwable, T2 extends Throwable, T3 extends Throwable, T4 extends Throwable
T1 - T2 - T3 - T4 - t1 - t2 - t3 - t4 - T1T2T3T4T1 extends Throwablepublic Throwable getResolvingCause()
Copyright © 2015. All rights reserved.