diff options
Diffstat (limited to 'catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java index d3214fbcd9..83a2934746 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/InputsValuesMergingBusinessLogic.java @@ -7,9 +7,9 @@ * 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. @@ -17,15 +17,14 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.be.components.merge.input; +import java.util.List; +import java.util.Map; import org.apache.commons.lang.StringUtils; import org.openecomp.sdc.be.dao.utils.MapUtil; import org.openecomp.sdc.be.model.InputDefinition; -import java.util.List; -import java.util.Map; @org.springframework.stereotype.Component public class InputsValuesMergingBusinessLogic { @@ -33,15 +32,16 @@ public class InputsValuesMergingBusinessLogic { * Merge old inputs values into the updated inputs */ public void mergeComponentInputs(List<InputDefinition> oldInputs, List<InputDefinition> inputsToMerge) { - Map<String, InputDefinition> oldInputsByName = MapUtil.toMap(oldInputs, InputDefinition::getName); + Map<String, InputDefinition> oldInputsByName = MapUtil.toMap(oldInputs, InputDefinition::getName); Map<String, InputDefinition> inputsToMergeByName = MapUtil.toMap(inputsToMerge, InputDefinition::getName); mergeComponentInputs(oldInputsByName, inputsToMergeByName); } - + /** - * Merge old inputs values into the updated inputs - * An input value is merged if the input previous version had a user defined value and its value is empty in current version - * @param oldInputs the currently persisted inputs mapped by their names + * Merge old inputs values into the updated inputs An input value is merged if the input previous version had a user defined value and its value + * is empty in current version + * + * @param oldInputs the currently persisted inputs mapped by their names * @param updatedInputs the currently being update inputs mapped by their names */ public void mergeComponentInputs(Map<String, InputDefinition> oldInputs, Map<String, InputDefinition> updatedInputs) { @@ -69,6 +69,4 @@ public class InputsValuesMergingBusinessLogic { private boolean isNonEmptyDefaultValue(InputDefinition input) { return input != null && !isEmptyDefaultValue(input); } - - } |