2  * ============LICENSE_START=======================================================
 
   3  *  Copyright (C) 2019 Ericsson. All rights reserved.
 
   4  * ================================================================================
 
   5  * Licensed under the Apache License, Version 2.0 (the "License");
 
   6  * you may not use this file except in compliance with the License.
 
   7  * You may obtain a copy of the License at
 
   9  *      http://www.apache.org/licenses/LICENSE-2.0
 
  11  * Unless required by applicable law or agreed to in writing, software
 
  12  * distributed under the License is distributed on an "AS IS" BASIS,
 
  13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  14  * See the License for the specific language governing permissions and
 
  15  * limitations under the License.
 
  17  * SPDX-License-Identifier: Apache-2.0
 
  18  * ============LICENSE_END=========================================================
 
  20 package org.onap.so.bpmn.infrastructure.adapter.vnfm.tasks.utils;
 
  22 import java.io.Serializable;
 
  23 import java.util.ArrayList;
 
  24 import java.util.HashMap;
 
  25 import java.util.List;
 
  27 import java.util.stream.Collectors;
 
  28 import java.util.stream.Stream;
 
  29 import org.onap.vnfmadapter.v1.model.ExternalVirtualLink;
 
  32  * Wrapper class for instance parameters which are based on SOL003
 
  34  * @author waqas.ikram@est.tech
 
  36 public class InputParameter implements Serializable {
 
  38     private static final long serialVersionUID = 42034634585595304L;
 
  40     private Map<String, String> additionalParams = new HashMap<>();
 
  42     private List<ExternalVirtualLink> extVirtualLinks = new ArrayList<>();
 
  44     public InputParameter() {}
 
  46     public InputParameter(final Map<String, String> additionalParams, final List<ExternalVirtualLink> extVirtualLinks) {
 
  47         this.additionalParams = additionalParams;
 
  48         this.extVirtualLinks = extVirtualLinks;
 
  52      * @return the additionalParams
 
  54     public Map<String, String> getAdditionalParams() {
 
  55         return additionalParams;
 
  59      * @return the extVirtualLinks
 
  61     public List<ExternalVirtualLink> getExtVirtualLinks() {
 
  62         return extVirtualLinks;
 
  66      * @param additionalParams the additionalParams to set
 
  68     public void setAdditionalParams(final Map<String, String> additionalParams) {
 
  69         this.additionalParams = additionalParams;
 
  72     public void putAdditionalParams(final Map<String, String> additionalParams) {
 
  73         if (additionalParams != null) {
 
  74             this.additionalParams.putAll(additionalParams);
 
  79      * @param extVirtualLinks the extVirtualLinks to set
 
  81     public void setExtVirtualLinks(final List<ExternalVirtualLink> extVirtualLinks) {
 
  82         this.extVirtualLinks = extVirtualLinks;
 
  85     public void addExtVirtualLinks(final List<ExternalVirtualLink> extVirtualLinks) {
 
  86         if (extVirtualLinks != null) {
 
  87             this.extVirtualLinks = Stream.concat(this.extVirtualLinks.stream(), extVirtualLinks.stream()).distinct()
 
  88                     .collect(Collectors.toList());
 
  93     public String toString() {
 
  94         return this.getClass().getSimpleName() + " [additionalParams=" + additionalParams + ", extVirtualLinks="
 
  95                 + extVirtualLinks + "]";