Package org.eclipse.ditto.json
Class JsonRuntimeException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.eclipse.ditto.json.JsonRuntimeException
- All Implemented Interfaces:
Serializable
,JsonException
- Direct Known Subclasses:
JsonFieldSelectorInvalidException
,JsonKeyInvalidException
,JsonMissingFieldException
,JsonParseException
,JsonPointerInvalidException
Common base type of all unchecked JSON exceptions.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A mutable builder for aJsonRuntimeException
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the description which should be reported to the user.Returns the error code to uniquely identify this exception.getHref()
Returns a link with which the user can find further information regarding this exception.newBuilder
(String errorCode) Returns a builder for fluently creating instances ofJsonRuntimeException
s..Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
JsonRuntimeException
protected JsonRuntimeException(String errorCode, @Nullable String message, @Nullable String description, @Nullable Throwable cause, @Nullable URI href) Constructs a newJsonRuntimeException
object with the specified values.- Parameters:
errorCode
- the error code of the exception.message
- the detail message for later retrieval withThrowable.getMessage()
.description
- a description with further information about the exception.cause
- the cause of the exception for later retrieval withThrowable.getCause()
.href
- a link to a resource which provides further information about the exception.- Throws:
NullPointerException
- iferrorCode
isnull
.IllegalArgumentException
- iferrorCode
is empty.
-
-
Method Details
-
newBuilder
Returns a builder for fluently creating instances ofJsonRuntimeException
s..- Parameters:
errorCode
- a code which uniquely identifies the exception.- Returns:
- a new builder for JsonRuntimeException objects.
- Throws:
NullPointerException
- iferrorCode
isnull
.IllegalArgumentException
- iferrorCode
is empty.
-
getErrorCode
Description copied from interface:JsonException
Returns the error code to uniquely identify this exception.- Specified by:
getErrorCode
in interfaceJsonException
- Returns:
- the error code.
-
getDescription
Description copied from interface:JsonException
Returns the description which should be reported to the user.- Specified by:
getDescription
in interfaceJsonException
- Returns:
- the description.
-
getHref
Description copied from interface:JsonException
Returns a link with which the user can find further information regarding this exception.- Specified by:
getHref
in interfaceJsonException
- Returns:
- a link to provide the user with further information about this exception.
-