/*
 * Copyright 2011-2016 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.exceptions;

import java.util.Collection;
import java.util.Collections;
import java.util.Map;

import com.b2international.snowowl.core.merge.MergeConflict;
import com.google.common.base.Objects;

/**
 * @since 4.7
 */
public class MergeConflictException extends ConflictException {

	private static final long serialVersionUID = -2143620528072069325L;

	private final Map<String, Object> details;
	private final Collection<MergeConflict> conflicts;

	public MergeConflictException(final Collection<MergeConflict> conflicts, final String message, final Object... args) {
		this(conflicts, Collections.<String, Object>emptyMap(), message, args);
	}
	
	public MergeConflictException(final Collection<MergeConflict> conflicts, final Map<String, Object> details, final String message, final Object... args) {
		super(message, args);
		this.details = details;
		this.conflicts = conflicts;
	}

	@Override
	protected Map<String, Object> getAdditionalInfo() {
		return details;
	}

	public Collection<MergeConflict> getConflicts() {
		return conflicts;
	}
	
	@Override
	public String toString() {
		return Objects.toStringHelper(this).add("details", details).toString();
	}
}

@@ -708,38 +708,8 @@
 on;%0A
-import java.util.Collections;%0A
 impo
@@ -826,16 +826,63 @@
 Objects;
+%0Aimport com.google.common.collect.ImmutableMap;
 %0A%0A/**%0A *
@@ -1271,19 +1271,20 @@
 ts, 
-Collections
+ImmutableMap
 .%3CSt
@@ -1300,17 +1300,33 @@
 ect%3E
-emptyMap(
+of(%22conflicts%22, conflicts
 ), m

Include conflicts in the details section of ApiError