/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix Foundation.
+ * Modifications Copyright (C) 2020 AT&T
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.Map;
import java.util.Map.Entry;
-
import javax.ws.rs.core.Response;
-
import lombok.NonNull;
-
import org.onap.policy.models.base.PfConceptContainer;
import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelRuntimeException;
*
* @param originalTemplate the original service template
* @param fragmentTemplate the fragment being added to the original service template
- * @return
+ * @return JpaToscaServiceTemplate
*/
public static JpaToscaServiceTemplate addFragment(@NonNull final JpaToscaServiceTemplate originalTemplate,
@NonNull final JpaToscaServiceTemplate fragmentTemplate) {
for (Entry<PfConceptKey, ? extends JpaToscaEntityType<? extends ToscaEntity>> fragmentEntry : fragmentContainer
.getConceptMap().entrySet()) {
- JpaToscaEntityType<? extends ToscaEntity> containerEntry =
+ JpaToscaEntityType<? extends ToscaEntity> containerEntity =
compositeContainer.getConceptMap().get(fragmentEntry.getKey());
- if (containerEntry != null && !containerEntry.equals(fragmentEntry.getValue())) {
+ if (containerEntity != null && containerEntity.compareTo(fragmentEntry.getValue()) != 0) {
result.addValidationMessage(new PfValidationMessage(fragmentEntry.getKey(),
ToscaServiceTemplateUtils.class,
ValidationResult.INVALID, "entity in incoming fragment does not equal existing entity"));