Package org.eclipse.ditto.json
Interface JsonExceptionBuilder<T extends JsonException>
- Type Parameters:
T
- type of the exception this builder builds.
- All Known Implementing Classes:
AbstractJsonExceptionBuilder
,JsonFieldSelectorInvalidException.Builder
,JsonKeyInvalidException.Builder
,JsonMissingFieldException.Builder
,JsonParseException.Builder
,JsonPointerInvalidException.Builder
,JsonRuntimeException.Builder
public interface JsonExceptionBuilder<T extends JsonException>
A mutable builder for a
JsonException
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds an instance of the target exception type using the provided data.Sets the cause which led to the exception to be built.Sets the cause which led to the exception to be built.description
(String description) Sets a description with further information about the exception to be built.description
(Supplier<String> descriptionSupplier) Sets a description with further information about the exception to be built.Sets a link to a resource which provides further information about the exception to be built.Sets a link to a resource which provides further information about the exception to be built.Sets the detail message of the exception to be built.Sets the detail message of the exception to be built.
-
Method Details
-
message
Sets the detail message of the exception to be built.- Parameters:
message
- the detail message.- Returns:
- this builder to allow method chaining.
-
message
Sets the detail message of the exception to be built.- Parameters:
messageSupplier
- supplier of the message to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifmessageSupplier
isnull
.
-
description
Sets a description with further information about the exception to be built.- Parameters:
description
- a description.- Returns:
- this builder to allow method chaining.
-
description
Sets a description with further information about the exception to be built.- Parameters:
descriptionSupplier
- supplier of the description to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifmessageSupplier
isnull
.
-
cause
Sets the cause which led to the exception to be built.- Parameters:
cause
- the cause.- Returns:
- this builder to allow method chaining.
-
cause
Sets the cause which led to the exception to be built.- Parameters:
causeSupplier
- supplier of the cause to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifmessageSupplier
isnull
.
-
href
Sets a link to a resource which provides further information about the exception to be built.- Parameters:
href
- a link to further information.- Returns:
- this builder to allow method chaining.
-
href
Sets a link to a resource which provides further information about the exception to be built.- Parameters:
hrefSupplier
- supplier of the link to be set.- Returns:
- this builder to allow method chaining.
- Throws:
NullPointerException
- ifmessageSupplier
isnull
.
-
build
T build()Builds an instance of the target exception type using the provided data.- Returns:
- a new exception of the target type.
-