| | |
| | | |
| | | /** |
| | | * Modifiable result implementation. |
| | | * |
| | | * |
| | | * @param <S> |
| | | * The type of result. |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * Creates a new modifiable result implementation using the provided |
| | | * result code. |
| | | * |
| | | * Creates a new modifiable result implementation using the provided result |
| | | * code. |
| | | * |
| | | * @param resultCode |
| | | * The result code. |
| | | * @throws NullPointerException |
| | | * If {@code resultCode} was {@code null}. |
| | | */ |
| | | AbstractResultImpl(ResultCode resultCode) throws NullPointerException |
| | | AbstractResultImpl(final ResultCode resultCode) throws NullPointerException |
| | | { |
| | | this.resultCode = resultCode; |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final S addReferralURI(String uri) throws NullPointerException |
| | | public final S addReferralURI(final String uri) throws NullPointerException |
| | | { |
| | | Validator.ensureNotNull(uri); |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final S clearReferralURIs() |
| | | { |
| | | referralURIs.clear(); |
| | | return getThis(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final Throwable getCause() |
| | | { |
| | | return cause; |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final Iterable<String> getReferralURIs() |
| | | public final List<String> getReferralURIs() |
| | | { |
| | | return referralURIs; |
| | | } |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final boolean hasReferralURIs() |
| | | { |
| | | return !referralURIs.isEmpty(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final boolean isReferral() |
| | | { |
| | | final ResultCode code = getResultCode(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final S setCause(Throwable cause) |
| | | public final S setCause(final Throwable cause) |
| | | { |
| | | this.cause = cause; |
| | | return getThis(); |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final S setDiagnosticMessage(String message) |
| | | public final S setDiagnosticMessage(final String message) |
| | | { |
| | | if (message == null) |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final S setMatchedDN(String dn) |
| | | public final S setMatchedDN(final String dn) |
| | | { |
| | | if (dn == null) |
| | | { |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final S setResultCode(ResultCode resultCode) |
| | | public final S setResultCode(final ResultCode resultCode) |
| | | throws NullPointerException |
| | | { |
| | | Validator.ensureNotNull(resultCode); |