2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2020 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.etsi.nfvo.ns.lcm.bpmn.flows.nsd;
22 import static org.onap.so.etsi.nfvo.ns.lcm.database.beans.utils.Utils.toIndentedString;
23 import java.io.Serializable;
24 import java.util.ArrayList;
25 import java.util.HashMap;
26 import java.util.List;
28 import java.util.Objects;
31 * @author Waqas Ikram (waqas.ikram@est.tech)
34 public class NetworkServiceDescriptor implements Serializable {
36 private static final long serialVersionUID = -1739293595041180242L;
40 private Map<String, Object> properties = new HashMap<>();
42 private List<VirtualNetworkFunction> vnfs = new ArrayList<>();
44 public String getType() {
48 public void setType(final String type) {
52 public NetworkServiceDescriptor type(final String type) {
57 public Map<String, Object> getProperties() {
61 public void setProperties(final Map<String, Object> properties) {
62 this.properties = properties;
65 public NetworkServiceDescriptor properties(final Map<String, Object> properties) {
66 this.properties = properties;
70 public List<VirtualNetworkFunction> getVnfs() {
74 public void setVnfs(final List<VirtualNetworkFunction> vnfs) {
78 this.vnfs = new ArrayList<>();
82 public NetworkServiceDescriptor addVnfPkgIdsItem(final VirtualNetworkFunction vnf) {
83 if (this.vnfs == null) {
84 this.vnfs = new ArrayList<>();
90 public NetworkServiceDescriptor vnfs(final List<VirtualNetworkFunction> vnfs) {
96 public int hashCode() {
97 return Objects.hash(type, properties, vnfs);
101 public boolean equals(final Object obj) {
102 if (obj instanceof NetworkServiceDescriptor) {
103 final NetworkServiceDescriptor other = (NetworkServiceDescriptor) obj;
104 return Objects.equals(type, other.type) && Objects.equals(properties, other.properties)
105 && Objects.equals(vnfs, other.vnfs);
111 public String toString() {
112 final StringBuilder sb = new StringBuilder();
113 sb.append("class NetworkServiceDescriptor {\n");
114 sb.append(" type: ").append(toIndentedString(type)).append("\n");
115 sb.append(" properties: ").append(toIndentedString(properties)).append("\n");
116 sb.append(" vnfs: ").append(toIndentedString(vnfs)).append("\n");
118 return sb.toString();