/*
 * Copyright 2020 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.core.request;

import java.util.Set;

import com.b2international.snowowl.core.compare.ConceptMapCompareConfigurationProperties;
import com.b2international.snowowl.core.compare.ConceptMapCompareResult;
import com.b2international.snowowl.core.domain.BranchContext;
import com.b2international.snowowl.core.uri.ComponentURI;

/**
* @since 7.8
*/
public final class ConceptMapCompareRequestBuilder 
		extends ResourceRequestBuilder<ConceptMapCompareRequestBuilder, BranchContext, ConceptMapCompareResult>
		implements RevisionIndexRequestBuilder<ConceptMapCompareResult> {
	
	private final ComponentURI baseConceptMapURI;
	private final ComponentURI compareConceptMapURI;
	
	private int limit = 5000;
	private Set<ConceptMapCompareConfigurationProperties> compareConfig = ConceptMapCompareConfigurationProperties.DEFAULT_SELECTED_PROPERTIES;
	private String preferredDisplay = "FSN";

	public ConceptMapCompareRequestBuilder(ComponentURI baseConceptMapURI, ComponentURI compareConceptMapURI) {
		this.baseConceptMapURI = baseConceptMapURI;
		this.compareConceptMapURI = compareConceptMapURI;
	}
	
	public ConceptMapCompareRequestBuilder setLimit(int limit) {
		this.limit = limit;
		return getSelf();
	}
	
	public ConceptMapCompareRequestBuilder setPreferredDisplay(String preferredDisplay) {
		this.preferredDisplay = preferredDisplay;
		return getSelf();
	}
	
	public ConceptMapCompareRequestBuilder setCompareConfig(Set<ConceptMapCompareConfigurationProperties> compareConfig) {
		this.compareConfig = compareConfig;
		return getSelf();
	}
	
	@Override
	protected ResourceRequest<BranchContext, ConceptMapCompareResult> create() {
		return new ConceptMapCompareRequest(baseConceptMapURI, compareConceptMapURI, limit, compareConfig, preferredDisplay);
	}
	
}

@@ -1222,16 +1222,79 @@
 lt%3E %7B%0A%09%0A
+%09private static final int MAX_LIMIT = Integer.MAX_VALUE - 1;%0A%09%0A
 %09private
@@ -1800,24 +1800,122 @@
 ptMapURI;%0A%09%7D
+%0A%0A%09public ConceptMapCompareRequestBuilder all() %7B%0A%09%09this.limit = MAX_LIMIT;%0A%09%09return getSelf();%0A%09%7D
 %0A%09%0A%09public C

add configuration to return all result