From 4aa1cf5e26d49ab1273d6affc58a5ac70b870ec4 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Fri, 29 Mar 2013 14:55:14 +0000
Subject: [PATCH] Very minor code cleanup to requests and responses package:
---
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java | 57 +++++++++++----------------------------------------------
1 files changed, 11 insertions(+), 46 deletions(-)
diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java
index 22155f6..19fa54e 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/requests/ModifyRequestImpl.java
@@ -44,62 +44,38 @@
*/
final class ModifyRequestImpl extends AbstractRequestImpl<ModifyRequest> implements ModifyRequest {
private final List<Modification> changes = new LinkedList<Modification>();
-
private DN name;
- /**
- * Creates a new modify request using the provided distinguished name.
- *
- * @param name
- * The distinguished name of the entry to be modified.
- * @throws NullPointerException
- * If {@code name} was {@code null}.
- */
ModifyRequestImpl(final DN name) {
this.name = name;
}
- /**
- * Creates a new modify request that is an exact copy of the provided
- * request.
- *
- * @param modifyRequest
- * The modify request to be copied.
- * @throws NullPointerException
- * If {@code modifyRequest} was {@code null} .
- */
ModifyRequestImpl(final ModifyRequest modifyRequest) {
super(modifyRequest);
this.name = modifyRequest.getName();
// Deep copy.
- for (Modification modification : modifyRequest.getModifications()) {
- ModificationType type = modification.getModificationType();
- Attribute attribute = new LinkedAttribute(modification.getAttribute());
- Modification copy = new Modification(type, attribute);
+ for (final Modification modification : modifyRequest.getModifications()) {
+ final ModificationType type = modification.getModificationType();
+ final Attribute attribute = new LinkedAttribute(modification.getAttribute());
+ final Modification copy = new Modification(type, attribute);
this.changes.add(copy);
}
}
- /**
- * {@inheritDoc}
- */
+ @Override
public <R, P> R accept(final ChangeRecordVisitor<R, P> v, final P p) {
return v.visitChangeRecord(p, this);
}
- /**
- * {@inheritDoc}
- */
+ @Override
public ModifyRequest addModification(final Modification change) {
Validator.ensureNotNull(change);
changes.add(change);
return this;
}
- /**
- * {@inheritDoc}
- */
+ @Override
public ModifyRequest addModification(final ModificationType type,
final String attributeDescription, final Object... values) {
Validator.ensureNotNull(type, attributeDescription, values);
@@ -107,41 +83,30 @@
return this;
}
- /**
- * {@inheritDoc}
- */
+ @Override
public List<Modification> getModifications() {
return changes;
}
- /**
- * {@inheritDoc}
- */
+ @Override
public DN getName() {
return name;
}
- /**
- * {@inheritDoc}
- */
+ @Override
public ModifyRequest setName(final DN dn) {
Validator.ensureNotNull(dn);
this.name = dn;
return this;
}
- /**
- * {@inheritDoc}
- */
+ @Override
public ModifyRequest setName(final String dn) {
Validator.ensureNotNull(dn);
this.name = DN.valueOf(dn);
return this;
}
- /**
- * {@inheritDoc}
- */
@Override
public String toString() {
final StringBuilder builder = new StringBuilder();
--
Gitblit v1.10.0