/** * Adds an RpcError. * * @param error the RpcError */ public RpcResultBuilder<T> withRpcError(final RpcError error) { addError(error); return this; }
/** * Adds a warning to the result. * * @param errorType the conceptual layer at which the warning occurred. * @param tag a short string that identifies the general type of warning condition. See * {@link RpcError#getTag} for a list of suggested values. * @param message a string suitable for human display that describes the warning condition. */ public RpcResultBuilder<T> withWarning(final ErrorType errorType, final String tag, final String message) { addError(ErrorSeverity.WARNING, errorType, tag, message, null, null, null); return this; }
/** * Adds an error to the result. * * @param errorType the conceptual layer at which the error occurred. * @param tag a short string that identifies the general type of error condition. See * {@link RpcError#getTag} for a list of suggested values. * @param message a string suitable for human display that describes the error condition. */ public RpcResultBuilder<T> withError(final ErrorType errorType, final String tag, final String message) { addError(ErrorSeverity.ERROR, errorType, tag, message, null, null, null); return this; }
/** * Adds an error to the result. The general error tag defaults to "operation-failed". * * @param errorType the conceptual layer at which the error occurred. * @param message a string suitable for human display that describes the error condition. */ public RpcResultBuilder<T> withError(final ErrorType errorType, final String message) { addError(ErrorSeverity.ERROR, errorType, null, message, null, null, null); return this; }
/** * Adds an RpcError. * * @param error the RpcError */ public RpcResultBuilder<T> withRpcError(final RpcError error) { addError(error); return this; }
/** * Adds an error to the result. The general error tag defaults to "operation-failed". * * @param errorType the conceptual layer at which the error occurred. * @param message a string suitable for human display that describes the error condition. * @param cause the exception that triggered the error. */ public RpcResultBuilder<T> withError(final ErrorType errorType, final String message, final Throwable cause) { addError(ErrorSeverity.ERROR, errorType, null, message, null, null, cause); return this; }
/** * Adds an error to the result. The general error tag defaults to "operation-failed". * * @param errorType the conceptual layer at which the error occurred. * @param message a string suitable for human display that describes the error condition. * @param cause the exception that triggered the error. */ public RpcResultBuilder<T> withError(final ErrorType errorType, final String message, final Throwable cause) { addError(ErrorSeverity.ERROR, errorType, null, message, null, null, cause); return this; }
/** * Adds a warning to the result. * * @param errorType the conceptual layer at which the warning occurred. * @param tag a short string that identifies the general type of warning condition. See * {@link RpcError#getTag} for a list of suggested values. * @param message a string suitable for human display that describes the warning condition. */ public RpcResultBuilder<T> withWarning(final ErrorType errorType, final String tag, final String message) { addError(ErrorSeverity.WARNING, errorType, tag, message, null, null, null); return this; }
/** * Adds an error to the result. The general error tag defaults to "operation-failed". * * @param errorType the conceptual layer at which the error occurred. * @param message a string suitable for human display that describes the error condition. */ public RpcResultBuilder<T> withError(final ErrorType errorType, final String message) { addError(ErrorSeverity.ERROR, errorType, null, message, null, null, null); return this; }
/** * Adds an error to the result. * * @param errorType the conceptual layer at which the error occurred. * @param tag a short string that identifies the general type of error condition. See * {@link RpcError#getTag} for a list of suggested values. * @param message a string suitable for human display that describes the error condition. */ public RpcResultBuilder<T> withError(final ErrorType errorType, final String tag, final String message) { addError(ErrorSeverity.ERROR, errorType, tag, message, null, null, null); return this; }
/** * Adds RpcErrors. * * @param rpcErrors the list of RpcErrors */ public RpcResultBuilder<T> withRpcErrors(final Collection<? extends RpcError> rpcErrors) { if (rpcErrors != null) { for (RpcError error : rpcErrors) { addError(error); } } return this; }
/** * Adds RpcErrors. * * @param rpcErrors the list of RpcErrors */ public RpcResultBuilder<T> withRpcErrors(final Collection<? extends RpcError> rpcErrors) { if (rpcErrors != null) { for (RpcError error : rpcErrors) { addError(error); } } return this; }
/** * Adds an error to the result. * * @param errorType the conceptual layer at which the error occurred. * @param tag a short string that identifies the general type of error condition. See * {@link RpcError#getTag} for a list of suggested values. * @param message a string suitable for human display that describes the error condition. * @param applicationTag a short string that identifies the specific type of error condition. * @param info a string containing additional information to provide extended * and/or implementation-specific debugging information. * @param cause the exception that triggered the error. */ public RpcResultBuilder<T> withError(final ErrorType errorType, final String tag, final String message, final String applicationTag, final String info, final Throwable cause) { addError(ErrorSeverity.ERROR, errorType, tag, message, applicationTag, info, cause); return this; }
/** * Adds a warning to the result. * * @param errorType the conceptual layer at which the warning occurred. * @param tag a short string that identifies the general type of warning condition. See * {@link RpcError#getTag} for a list of suggested values. * @param message a string suitable for human display that describes the warning condition. * @param applicationTag a short string that identifies the specific type of warning condition. * @param info a string containing additional information to provide extended * and/or implementation-specific debugging information. * @param cause the exception that triggered the warning. */ public RpcResultBuilder<T> withWarning(final ErrorType errorType, final String tag, final String message, final String applicationTag, final String info, final Throwable cause) { addError(ErrorSeverity.WARNING, errorType, tag, message, applicationTag, info, cause); return this; }
/** * Adds a warning to the result. * * @param errorType the conceptual layer at which the warning occurred. * @param tag a short string that identifies the general type of warning condition. See * {@link RpcError#getTag} for a list of suggested values. * @param message a string suitable for human display that describes the warning condition. * @param applicationTag a short string that identifies the specific type of warning condition. * @param info a string containing additional information to provide extended * and/or implementation-specific debugging information. * @param cause the exception that triggered the warning. */ public RpcResultBuilder<T> withWarning(final ErrorType errorType, final String tag, final String message, final String applicationTag, final String info, final Throwable cause) { addError(ErrorSeverity.WARNING, errorType, tag, message, applicationTag, info, cause); return this; }
/** * Adds an error to the result. * * @param errorType the conceptual layer at which the error occurred. * @param tag a short string that identifies the general type of error condition. See * {@link RpcError#getTag} for a list of suggested values. * @param message a string suitable for human display that describes the error condition. * @param applicationTag a short string that identifies the specific type of error condition. * @param info a string containing additional information to provide extended * and/or implementation-specific debugging information. * @param cause the exception that triggered the error. */ public RpcResultBuilder<T> withError(final ErrorType errorType, final String tag, final String message, final String applicationTag, final String info, final Throwable cause) { addError(ErrorSeverity.ERROR, errorType, tag, message, applicationTag, info, cause); return this; }
private void addError(final ErrorSeverity severity, final ErrorType errorType, final String tag, final String message, final String applicationTag, final String info, final Throwable cause) { addError(new RpcErrorImpl(severity, errorType, tag != null ? tag : "operation-failed", message, applicationTag, info, cause)); }
private void addError(final ErrorSeverity severity, final ErrorType errorType, final String tag, final String message, final String applicationTag, final String info, final Throwable cause) { addError(new RpcErrorImpl(severity, errorType, tag != null ? tag : "operation-failed", message, applicationTag, info, cause)); }