@Override public DittoRuntimeException setDittoHeaders(final DittoHeaders dittoHeaders) { return newBuilder(this).dittoHeaders(dittoHeaders).build(); }
/** * Constructs a new {@code InvalidRqlExpressionException} object with given message. * * @param message detail message. This message can be later retrieved by the {@link #getMessage()} method. * @param dittoHeaders the headers of the command which resulted in this exception. * @return the new InvalidRqlExpressionException. */ public static InvalidRqlExpressionException fromMessage(final String message, final DittoHeaders dittoHeaders) { return new Builder() .dittoHeaders(dittoHeaders) .message(message) .build(); }
/** * A mutable builder for a {@link DittoHeaderInvalidException} in case of an invalid type. * * @param headerName the key of the header. * @param headerValue the value of the header. * @param headerType the type of the header. (int, String, entity-tag...) * @return the builder. */ public static DittoHeaderInvalidException.Builder newInvalidTypeBuilder(final String headerName, final String headerValue, final String headerType) { return new DittoHeaderInvalidException.Builder(headerName, headerValue, headerType); }
/** * Construct a builder {@code b} such that {@code b.build()} has identical class and fields as {@code this}. * <p> * A subclass should extend this method if it adds another field. * * @return A builder to construct an identical copy of {@code this}. */ public DittoRuntimeExceptionBuilder<? extends DittoRuntimeException> getBuilder() { return getEmptyBuilder() .dittoHeaders(dittoHeaders) .message(getMessage()) .cause(getCause()) .description(description) .href(href); }
/** * @throws NullPointerException if {@code jsonString} is {@code null}. * @throws IllegalArgumentException if {@code jsonString} is empty. * @throws JsonTypeNotParsableException if the {@code jsonObject}'s {@code type} was unknown to the parser. * @throws DittoJsonException if {@code jsonString} does not contain a valid JSON object. */ @Override public T parse(final String jsonString, final DittoHeaders dittoHeaders) { return DittoJsonException.wrapJsonRuntimeException(jsonString, dittoHeaders, this::fromJson); }
/** * Returns a new mutable builder for fluently creating instances of {@code DittoRuntimeException}s.. * * @param errorCode a code which uniquely identifies the exception. * @param statusCode the HTTP status code. * @return the new builder. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code errorCode} is empty. */ public static Builder newBuilder(final String errorCode, final HttpStatusCode statusCode) { return new Builder(errorCode, statusCode); }
/** * Builds an instance of the target exception type using the provided data. * * @return the new exception. */ public T build() { return doBuild(dittoHeaders, message, description, cause, href); }
/** * A mutable builder for a {@code InvalidRqlExpressionException}. * * @return the builder. */ public static Builder newBuilder() { return new Builder(); }
@Override protected InvalidRqlExpressionException doBuild(final DittoHeaders dittoHeaders, final String message, final String description, final Throwable cause, final URI href) { return new InvalidRqlExpressionException(dittoHeaders, message, description, cause, href); } }
@Override public DittoRuntimeException setDittoHeaders(final DittoHeaders dittoHeaders) { return newBuilder(this).dittoHeaders(dittoHeaders).build(); }
/** * Constructs a new {@code InvalidRqlExpressionException} object with given message. * * @param message detail message. This message can be later retrieved by the {@link #getMessage()} method. * @param dittoHeaders the headers of the command which resulted in this exception. * @return the new InvalidRqlExpressionException. */ public static InvalidRqlExpressionException fromMessage(final String message, final DittoHeaders dittoHeaders) { return new Builder() .dittoHeaders(dittoHeaders) .message(message) .build(); }
/** * @throws NullPointerException if {@code jsonString} is {@code null}. * @throws IllegalArgumentException if {@code jsonString} is empty. * @throws JsonTypeNotParsableException if the {@code jsonObject}'s {@code type} was unknown to the parser. * @throws DittoJsonException if {@code jsonString} does not contain a valid JSON object. */ @Override public T parse(final String jsonString, final DittoHeaders dittoHeaders) { return DittoJsonException.wrapJsonRuntimeException(jsonString, dittoHeaders, this::fromJson); }
/** * A mutable builder for a {@link DittoHeaderInvalidException} with a custom message. * * @param customMessage the custom message * @return the builder. */ public static DittoHeaderInvalidException.Builder newCustomMessageBuilder(final String customMessage) { return new DittoHeaderInvalidException.Builder(customMessage); }
/** * Each subclass should override this method to provide an implementation of {@code * DittoRuntimeExceptionBuilder}. * <p> * Per default, an instance {@link Builder} is used, which builds a generic {@code DittoRuntimeException}. * * @return A builder to construct a DittoRuntimeException. */ protected DittoRuntimeExceptionBuilder<? extends DittoRuntimeException> getEmptyBuilder() { return new Builder(errorCode, statusCode); }
/** * Builds an instance of the target exception type using the provided data. * * @return the new exception. */ public T build() { return doBuild(dittoHeaders, message, description, cause, href); }
/** * A mutable builder for a {@code InvalidRqlExpressionException}. * * @return the builder. */ public static Builder newBuilder() { return new Builder(); }
/** * A mutable builder for a {@link DittoHeaderInvalidException} in case of an invalid type. * * @param headerName the key of the header. * @param headerValue the value of the header. * @param headerType the type of the header. (int, String, entity-tag...) * @return the builder. */ public static DittoHeaderInvalidException.Builder newInvalidTypeBuilder(final String headerName, final String headerValue, final String headerType) { return new DittoHeaderInvalidException.Builder(headerName, headerValue, headerType); }
/** * Returns a new mutable builder for fluently creating instances of {@code DittoRuntimeException}s.. * * @param errorCode a code which uniquely identifies the exception. * @param statusCode the HTTP status code. * @return the new builder. * @throws NullPointerException if any argument is {@code null}. * @throws IllegalArgumentException if {@code errorCode} is empty. */ public static Builder newBuilder(final String errorCode, final HttpStatusCode statusCode) { return new Builder(errorCode, statusCode); }
/** * A mutable builder for a {@link DittoHeaderInvalidException} with a custom message. * * @param customMessage the custom message * @return the builder. */ public static DittoHeaderInvalidException.Builder newCustomMessageBuilder(final String customMessage) { return new DittoHeaderInvalidException.Builder(customMessage); }
/** * Each subclass should override this method to provide an implementation of {@code * DittoRuntimeExceptionBuilder}. * <p> * Per default, an instance {@link Builder} is used, which builds a generic {@code DittoRuntimeException}. * * @return A builder to construct a DittoRuntimeException. */ protected DittoRuntimeExceptionBuilder<? extends DittoRuntimeException> getEmptyBuilder() { return new Builder(errorCode, statusCode); }