diff options
Diffstat (limited to 'common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java')
-rw-r--r-- | common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java index a3b28e57af..47ecde228e 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/MapComponentInstanceExternalRefs.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. @@ -23,14 +23,17 @@ package org.openecomp.sdc.be.datatypes.elements; import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * Maps an object type (e.g. "monitoring", "workflows" etc) to a list of external references. * * "monitoring" -> { "ref1", "ref2" }, * "workflows" -> { "ref1", "ref2" } - * */ public class MapComponentInstanceExternalRefs extends ToscaDataDefinition { @@ -58,9 +61,9 @@ public class MapComponentInstanceExternalRefs extends ToscaDataDefinition { * Adds a reference to the given object type. Will do nothing if already exist. * * @param objectType object type to associate reference to - * @param ref to add + * @param ref to add */ - public boolean addExternalRef(String objectType, String ref){ + public boolean addExternalRef(String objectType, String ref) { List<String> refList = this.getExternalRefsByObjectType(objectType); @@ -71,7 +74,7 @@ public class MapComponentInstanceExternalRefs extends ToscaDataDefinition { } //Add reference to list if does not exist - if (!refList.contains(ref)){ + if (!refList.contains(ref)) { return refList.add(ref); } @@ -79,7 +82,7 @@ public class MapComponentInstanceExternalRefs extends ToscaDataDefinition { } - public boolean deleteExternalRef(String objectType, String ref){ + public boolean deleteExternalRef(String objectType, String ref) { List<String> refList = this.getExternalRefsByObjectType(objectType); if (refList != null) { @@ -92,7 +95,7 @@ public class MapComponentInstanceExternalRefs extends ToscaDataDefinition { public boolean replaceExternalRef(String objectType, String oldRef, String newRef) { List<String> refList = this.getExternalRefsByObjectType(objectType); - if (refList != null && !refList.contains(newRef)) { + if (refList != null && !refList.contains(newRef)) { return Collections.replaceAll(refList, oldRef, newRef); } else { return false; |