From f2160f4bd1c8ac67e5a86a6710d431e8932877f9 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Fri, 28 May 2010 11:47:51 +0000
Subject: [PATCH] Synchronize SDK on java.net with internal repository.
---
sdk/src/org/opends/sdk/requests/SearchRequestImpl.java | 116 ++++++++++++----------------------------------------------
1 files changed, 24 insertions(+), 92 deletions(-)
diff --git a/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java b/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java
index 1199fd5..2337021 100644
--- a/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java
@@ -29,7 +29,6 @@
-import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -42,8 +41,8 @@
/**
* Search request implementation.
*/
-final class SearchRequestImpl extends
- AbstractRequestImpl<SearchRequest> implements SearchRequest
+final class SearchRequestImpl extends AbstractRequestImpl<SearchRequest>
+ implements SearchRequest
{
private final List<String> attributes = new LinkedList<String>();
@@ -65,25 +64,24 @@
/**
- * Creates a new search request using the provided distinguished name,
- * scope, and filter, decoded using the default schema.
+ * Creates a new search request using the provided distinguished name, scope,
+ * and filter, decoded using the default schema.
*
* @param name
- * The distinguished name of the base entry relative to which
- * the search is to be performed.
+ * The distinguished name of the base entry relative to which the
+ * search is to be performed.
* @param scope
* The scope of the search.
* @param filter
- * The filter that defines the conditions that must be
- * fulfilled in order for an entry to be returned.
+ * The filter that defines the conditions that must be fulfilled in
+ * order for an entry to be returned.
* @param attributeDescriptions
- * The names of the attributes to be included with each
- * entry.
+ * The names of the attributes to be included with each entry.
* @throws NullPointerException
- * If the {@code name}, {@code scope}, or {@code filter}
- * were {@code null}.
+ * If the {@code name}, {@code scope}, or {@code filter} were
+ * {@code null}.
*/
- SearchRequestImpl(DN name, SearchScope scope, Filter filter)
+ SearchRequestImpl(final DN name, final SearchScope scope, final Filter filter)
throws NullPointerException
{
this.name = name;
@@ -96,26 +94,10 @@
/**
* {@inheritDoc}
*/
- public SearchRequest addAttribute(
- Collection<String> attributeDescriptions)
- throws NullPointerException
- {
- Validator.ensureNotNull(attributeDescriptions);
-
- attributes.addAll(attributeDescriptions);
- return this;
- }
-
-
-
- /**
- * {@inheritDoc}
- */
- public SearchRequest addAttribute(String attributeDescription)
+ public SearchRequest addAttribute(final String attributeDescription)
throws NullPointerException
{
Validator.ensureNotNull(attributeDescription);
-
attributes.add(attributeDescription);
return this;
}
@@ -125,35 +107,7 @@
/**
* {@inheritDoc}
*/
- public SearchRequest addAttribute(String... attributeDescriptions)
- throws NullPointerException
- {
- Validator.ensureNotNull((Object) attributeDescriptions);
-
- for (final String attributeDescription : attributeDescriptions)
- {
- attributes.add(attributeDescription);
- }
- return this;
- }
-
-
-
- /**
- * {@inheritDoc}
- */
- public SearchRequest clearAttributes()
- {
- attributes.clear();
- return this;
- }
-
-
-
- /**
- * {@inheritDoc}
- */
- public Iterable<String> getAttributes()
+ public List<String> getAttributes()
{
return attributes;
}
@@ -223,16 +177,6 @@
/**
* {@inheritDoc}
*/
- public boolean hasAttributes()
- {
- return !attributes.isEmpty();
- }
-
-
-
- /**
- * {@inheritDoc}
- */
public boolean isTypesOnly()
{
return typesOnly;
@@ -243,21 +187,8 @@
/**
* {@inheritDoc}
*/
- public boolean removeAttribute(String attributeDescription)
- throws NullPointerException
- {
- Validator.ensureNotNull(attributeDescription);
-
- return attributes.remove(attributeDescription);
- }
-
-
-
- /**
- * {@inheritDoc}
- */
public SearchRequest setDereferenceAliasesPolicy(
- DereferenceAliasesPolicy policy) throws NullPointerException
+ final DereferenceAliasesPolicy policy) throws NullPointerException
{
Validator.ensureNotNull(policy);
@@ -270,7 +201,7 @@
/**
* {@inheritDoc}
*/
- public SearchRequest setFilter(Filter filter)
+ public SearchRequest setFilter(final Filter filter)
throws NullPointerException
{
Validator.ensureNotNull(filter);
@@ -284,7 +215,7 @@
/**
* {@inheritDoc}
*/
- public SearchRequest setFilter(String filter)
+ public SearchRequest setFilter(final String filter)
throws LocalizedIllegalArgumentException, NullPointerException
{
this.filter = Filter.valueOf(filter);
@@ -296,7 +227,7 @@
/**
* {@inheritDoc}
*/
- public SearchRequest setName(DN dn) throws NullPointerException
+ public SearchRequest setName(final DN dn) throws NullPointerException
{
Validator.ensureNotNull(dn);
@@ -309,7 +240,7 @@
/**
* {@inheritDoc}
*/
- public SearchRequest setName(String dn)
+ public SearchRequest setName(final String dn)
throws LocalizedIllegalArgumentException, NullPointerException
{
Validator.ensureNotNull(dn);
@@ -323,7 +254,7 @@
/**
* {@inheritDoc}
*/
- public SearchRequest setScope(SearchScope scope)
+ public SearchRequest setScope(final SearchScope scope)
throws NullPointerException
{
Validator.ensureNotNull(scope);
@@ -337,7 +268,7 @@
/**
* {@inheritDoc}
*/
- public SearchRequest setSizeLimit(int limit)
+ public SearchRequest setSizeLimit(final int limit)
throws LocalizedIllegalArgumentException
{
// FIXME: I18N error message.
@@ -352,7 +283,7 @@
/**
* {@inheritDoc}
*/
- public SearchRequest setTimeLimit(int limit)
+ public SearchRequest setTimeLimit(final int limit)
throws LocalizedIllegalArgumentException
{
// FIXME: I18N error message.
@@ -367,7 +298,7 @@
/**
* {@inheritDoc}
*/
- public SearchRequest setTypesOnly(boolean typesOnly)
+ public SearchRequest setTypesOnly(final boolean typesOnly)
{
this.typesOnly = typesOnly;
return this;
@@ -406,6 +337,7 @@
+ @Override
SearchRequest getThis()
{
return this;
--
Gitblit v1.10.0