Adding Basic NSD parser
[so.git] / so-etsi-nfvo / so-etsi-nfvo-ns-lcm / so-etsi-nfvo-ns-lcm-bpmn-flows / src / main / java / org / onap / so / etsi / nfvo / ns / lcm / bpmn / flows / nsd / VirtualNetworkFunction.java
1 /*-
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
8  * 
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  * 
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.
16  * 
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20 package org.onap.so.etsi.nfvo.ns.lcm.bpmn.flows.nsd;
21
22 import static org.onap.so.etsi.nfvo.ns.lcm.database.beans.utils.Utils.toIndentedString;
23 import java.io.Serializable;
24 import java.util.HashMap;
25 import java.util.List;
26 import java.util.Map;
27 import java.util.Objects;
28
29 /**
30  * @author Waqas Ikram (waqas.ikram@est.tech)
31  *
32  */
33 public class VirtualNetworkFunction implements Serializable {
34
35     private static final long serialVersionUID = 3164293220359211834L;
36
37     private String vnfdId;
38     private String vnfName;
39     private List<String> vnfmInfoList;
40     private Map<String, Object> properties = new HashMap<>();
41
42     public String getVnfdId() {
43         return vnfdId;
44     }
45
46     public void setVnfdId(final String vnfdId) {
47         this.vnfdId = vnfdId;
48     }
49
50     public VirtualNetworkFunction vnfdId(final String vnfdId) {
51         this.vnfdId = vnfdId;
52         return this;
53     }
54
55     public String getVnfName() {
56         return vnfName;
57     }
58
59     public void setVnfName(final String vnfName) {
60         this.vnfName = vnfName;
61     }
62
63     public VirtualNetworkFunction vnfName(final String vnfName) {
64         this.vnfName = vnfName;
65         return this;
66     }
67
68     public List<String> getVnfmInfoList() {
69         return vnfmInfoList;
70     }
71
72     public void setVnfmInfoList(final List<String> vnfmInfoList) {
73         this.vnfmInfoList = vnfmInfoList;
74     }
75
76     public VirtualNetworkFunction vnfmInfoList(final List<String> vnfmInfoList) {
77         this.vnfmInfoList = vnfmInfoList;
78         return this;
79     }
80
81     public Map<String, Object> getProperties() {
82         return properties;
83     }
84
85     public void setProperties(final Map<String, Object> properties) {
86         this.properties = properties;
87     }
88
89     public VirtualNetworkFunction properties(final Map<String, Object> properties) {
90         this.properties = properties;
91         return this;
92     }
93
94     @Override
95     public int hashCode() {
96         return Objects.hash(vnfdId, vnfName, vnfmInfoList, properties);
97     }
98
99     @Override
100     public boolean equals(final Object obj) {
101         if (obj instanceof VirtualNetworkFunction) {
102             final VirtualNetworkFunction other = (VirtualNetworkFunction) obj;
103             return Objects.equals(vnfdId, other.vnfdId) && Objects.equals(vnfName, other.vnfName)
104                     && Objects.equals(vnfmInfoList, other.vnfmInfoList) && Objects.equals(properties, other.properties);
105         }
106         return false;
107     }
108
109     @Override
110     public String toString() {
111         final StringBuilder sb = new StringBuilder();
112         sb.append("class VirtualNetworkFunction {\n");
113         sb.append("    vnfdId: ").append(toIndentedString(vnfdId)).append("\n");
114         sb.append("    vnfName: ").append(toIndentedString(vnfName)).append("\n");
115         sb.append("    vnfmInfo: ").append(toIndentedString(vnfmInfoList)).append("\n");
116         sb.append("    properties: ").append(toIndentedString(properties)).append("\n");
117
118         sb.append("}");
119         return sb.toString();
120     }
121
122
123 }