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 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

      JsonExceptionBuilder<T> message(Supplier<String> messageSupplier)
      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 - if messageSupplier is null.
    • description

      JsonExceptionBuilder<T> description(@Nullable String 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

      JsonExceptionBuilder<T> description(Supplier<String> descriptionSupplier)
      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 - if messageSupplier is null.
    • cause

      Sets the cause which led to the exception to be built.
      Parameters:
      cause - the cause.
      Returns:
      this builder to allow method chaining.
    • cause

      JsonExceptionBuilder<T> cause(Supplier<Throwable> causeSupplier)
      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 - if messageSupplier is null.
    • 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

      JsonExceptionBuilder<T> href(Supplier<URI> hrefSupplier)
      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 - if messageSupplier is null.
    • build

      T build()
      Builds an instance of the target exception type using the provided data.
      Returns:
      a new exception of the target type.