mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
20.32.2014 41d93d231b0c81eff8a0c9b301f9ea9818440727
opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/ErrorResultException.java
@@ -70,6 +70,28 @@
     *             If the provided result code does not represent a failure.
     * @throws NullPointerException
     *             If {@code resultCode} was {@code null}.
     * @deprecated use {@link #newErrorResult(ResultCode, CharSequence)} instead
     */
    @Deprecated
    public static ErrorResultException newErrorResult(ResultCode resultCode,
            String diagnosticMessage) {
        return newErrorResult(resultCode, (CharSequence) diagnosticMessage);
    }
    /**
     * Creates a new error result exception with the provided result code and
     * diagnostic message.
     *
     * @param resultCode
     *            The result code.
     * @param diagnosticMessage
     *            The diagnostic message, which may be empty or {@code null}
     *            indicating that none was provided.
     * @return The new error result exception.
     * @throws IllegalArgumentException
     *             If the provided result code does not represent a failure.
     * @throws NullPointerException
     *             If {@code resultCode} was {@code null}.
     */
    public static ErrorResultException newErrorResult(ResultCode resultCode,
            CharSequence diagnosticMessage) {
@@ -112,6 +134,31 @@
     *             If the provided result code does not represent a failure.
     * @throws NullPointerException
     *             If {@code resultCode} was {@code null}.
     * @deprecated use {@link #newErrorResult(ResultCode, CharSequence, Throwable)} instead
     */
    @Deprecated
    public static ErrorResultException newErrorResult(ResultCode resultCode,
            String diagnosticMessage, Throwable cause) {
        return newErrorResult(resultCode, (CharSequence) diagnosticMessage, cause);
    }
    /**
     * Creates a new error result exception with the provided result code,
     * diagnostic message, and cause.
     *
     * @param resultCode
     *            The result code.
     * @param diagnosticMessage
     *            The diagnostic message, which may be empty or {@code null}
     *            indicating that none was provided.
     * @param cause
     *            The throwable cause, which may be {@code null} indicating that
     *            none was provided.
     * @return The new error result exception.
     * @throws IllegalArgumentException
     *             If the provided result code does not represent a failure.
     * @throws NullPointerException
     *             If {@code resultCode} was {@code null}.
     */
    public static ErrorResultException newErrorResult(ResultCode resultCode,
            CharSequence diagnosticMessage, Throwable cause) {