// Path: ngsi2-client/src/main/java/com/orange/ngsi2/model/Error.java
// public class Error {
// 
//     private String error;
// 
//     @JsonInclude(JsonInclude.Include.NON_EMPTY)
//     private Optional<String> description;
// 
//     @JsonInclude(JsonInclude.Include.NON_EMPTY)
//     private Optional<Collection<String>> affectedItems;
// 
//     public Error() {
//     }
// 
//     public Error(String error) {
//         this.error = error;
//     }
// 
//     public Error(String error, Optional<String> description, Optional<Collection<String>> affectedItems) {
//         this.error = error;
//         this.description = description;
//         this.affectedItems = affectedItems;
//     }
// 
//     public String getError() {
//         return error;
//     }
// 
//     public void setError(String error) {
//         this.error = error;
//     }
// 
//     public Optional<String> getDescription() {
//         return description;
//     }
// 
//     public void setDescription(Optional<String> description) {
//         this.description = description;
//     }
// 
//     public Optional<Collection<String>> getAffectedItems() {
//         return affectedItems;
//     }
// 
//     public void setAffectedItems(Optional<Collection<String>> affectedItems) {
//         this.affectedItems = affectedItems;
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("error: %s | description: %s | affectedItems: %s", error, description.orElse(""), affectedItems.orElse(Collections.emptyList()));
//     }
// }


import com.orange.ngsi2.model.Error;
import java.util.Collection;
import java.util.Optional;
/*
 * Copyright (C) 2016 Orange
 *
 * 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.orange.ngsi2.exception;



/**
 * 409 TooManyResults
 */

public class ConflictingEntitiesException extends Ngsi2Exception {

    private final static String message = "Too many results. There are several results that match with the %s used in the request. Instead of, you can use %s";

// Path: ngsi2-client/src/main/java/com/orange/ngsi2/model/Error.java
// public class Error {
// 
//     private String error;
// 
//     @JsonInclude(JsonInclude.Include.NON_EMPTY)
//     private Optional<String> description;
// 
//     @JsonInclude(JsonInclude.Include.NON_EMPTY)
//     private Optional<Collection<String>> affectedItems;
// 
//     public Error() {
//     }
// 
//     public Error(String error) {
//         this.error = error;
//     }
// 
//     public Error(String error, Optional<String> description, Optional<Collection<String>> affectedItems) {
//         this.error = error;
//         this.description = description;
//         this.affectedItems = affectedItems;
//     }
// 
//     public String getError() {
//         return error;
//     }
// 
//     public void setError(String error) {
//         this.error = error;
//     }
// 
//     public Optional<String> getDescription() {
//         return description;
//     }
// 
//     public void setDescription(Optional<String> description) {
//         this.description = description;
//     }
// 
//     public Optional<Collection<String>> getAffectedItems() {
//         return affectedItems;
//     }
// 
//     public void setAffectedItems(Optional<Collection<String>> affectedItems) {
//         this.affectedItems = affectedItems;
//     }
// 
//     @Override
//     public String toString() {
//         return String.format("error: %s | description: %s | affectedItems: %s", error, description.orElse(""), affectedItems.orElse(Collections.emptyList()));
//     }
// }


// Path: ngsi2-client/src/main/java/com/orange/ngsi2/exception/ConflictingEntitiesException.java
import com.orange.ngsi2.model.Error;
import java.util.Collection;
import java.util.Optional;

/*
 * Copyright (C) 2016 Orange
 *
 * 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.orange.ngsi2.exception;



/**
 * 409 TooManyResults
 */

public class ConflictingEntitiesException extends Ngsi2Exception {

    private final static String message = "Too many results. There are several results that match with the %s used in the request. Instead of, you can use %s";

    public ConflictingEntitiesException(Error error) {