From 0e52d359d661d2fd95fa5c28058353f5d121173c Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Thu, 20 Sep 2012 22:32:04 +0000
Subject: [PATCH] Fix OPENDJ-597: Remove superfluous ByteString based constructors
---
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Attribute.java | 25 ++++++++-----------------
1 files changed, 8 insertions(+), 17 deletions(-)
diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Attribute.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Attribute.java
index 931e041..c7ace49 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Attribute.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/Attribute.java
@@ -40,21 +40,8 @@
* equality matching rule associated with the attribute description.
* <p>
* Any methods which accept {@code Object} based attribute values convert the
- * attribute values to instances of {@code ByteString} as follows:
- *
- * <pre>
- * Object object = ...;
- * ByteString value = null;
- * if (object instanceof ByteSequence)
- * {
- * value = ((ByteSequence)object).toByteString();
- * }
- * else
- * {
- * value = ByteString.valueOf(object.toString());
- * }
- * </pre>
- * <p>
+ * attribute values to instances of {@code ByteString} using
+ * {@link ByteString#valueOf(Object)}.
*/
public interface Attribute extends Set<ByteString> {
// TODO: matching against attribute value assertions.
@@ -121,7 +108,12 @@
* attribute if they are not already present (optional operation). Any
* attribute values which are already present will be added to
* {@code duplicateValues} if specified.
+ * <p>
+ * Any attribute values which are not instances of {@code ByteString} will
+ * be converted using the {@link ByteString#valueOf(Object)} method.
*
+ * @param <T>
+ * The type of the attribute value objects being added.
* @param values
* The attribute values to be added to this attribute.
* @param duplicateValues
@@ -134,8 +126,7 @@
* @throws NullPointerException
* If {@code values} was {@code null}.
*/
- boolean addAll(Collection<? extends ByteString> values,
- Collection<? super ByteString> duplicateValues);
+ <T> boolean addAll(Collection<T> values, Collection<? super T> duplicateValues);
/**
* Removes all of the attribute values from this attribute (optional
--
Gitblit v1.10.0