/*
 * Copyright 2011-2017 B2i Healthcare Pte Ltd, http://b2i.sg
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.b2international.snowowl.snomed.datastore.request;

import com.b2international.snowowl.snomed.SnomedConstants.Concepts;
import com.b2international.snowowl.snomed.datastore.request.SnomedComponentSearchRequest.OptionKey;

/**
 * Abstract superclass for building request for SNOMED CT component searches.
 * Clients should not extend. 
 * @since 5.3
 */
public abstract class SnomedComponentSearchRequestBuilder<B extends SnomedComponentSearchRequestBuilder<B, R>, R> extends SnomedSearchRequestBuilder<B, R> {
	
	public final B isActiveMemberOf(String refSetId) {
		return addOption(OptionKey.ACTIVE_MEMBER_OF, refSetId);
	}
	
	/**
	 * Filter the matches components to check whether the component ID from the specified namespace.
	 * 
	 * @param namespaceId
	 *            - the namespace identifier as a string
	 * @return SnomedComponentSearchRequestBuilder
	 * @see Concepts
	 */
	public final B filterByNamespace(String namespaceId) {
		
		return addOption(OptionKey.NAMESPACE, namespaceId);
	}

}

@@ -1278,20 +1278,16 @@
 ter 
-the 
 matches 
 comp
@@ -1286,81 +1286,68 @@
 hes 
-components to check whe
+by 
 the
+i
 r 
-the component ID from the specified namespace
+namespace (specified in their SNOMED CT identifier)
 .%0A%09 
@@ -1557,11 +1557,8 @@
 ) %7B%0A
-%09%09%0A
 %09%09re
@@ -1609,12 +1609,370 @@
 eId);%0A%09%7D
+%0A%09%0A%09/**%0A%09 * Filter matches by their namespace (specified in their SNOMED CT identifier).%0A%09 * %0A%09 * @param namespaceIds %0A%09 *            - the namespace identifiers%0A%09 * @return SnomedComponentSearchRequestBuilder%0A%09 * @see Concepts%0A%09 */%0A%09public final B filterByNamespaces(Iterable%3CString%3E namespaceIds) %7B%0A%09%09return addOption(OptionKey.NAMESPACE, namespaceIds);%0A%09%7D
 %0A%0A%7D%0A

support filtering components by multiple namespace IDs