Fix sonar issues
[vfc/nfvo/driver/vnfm/svnfm.git] / nokiav2 / driver / src / main / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / nokia / vnfm / notification / ReportedAffectedCp.java
1 /*
2  * Copyright 2016-2017, Nokia Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification;
17
18 import java.util.Objects;
19
20 /**
21  * Represent a single port change in the VNF
22  */
23 public class ReportedAffectedCp {
24     private String providerId;
25     private String cpdId;
26     private String ecpdId;
27     private String cpId; //the location of the resource in the Heat stack
28     private String tenantId;
29     private String ipAddress;
30     private String macAddress;
31     private String serverProviderId;
32     private String name;
33     private String networkProviderId;
34
35     /**
36      * @return the provider id of the port
37      */
38     public String getProviderId() {
39         return providerId;
40     }
41
42     /**
43      * @param providerId the provider id of the port
44      */
45     public void setProviderId(String providerId) {
46         this.providerId = providerId;
47     }
48
49     /**
50      * @return the identifier of the connection point of the port (may be null)
51      */
52     public String getCpdId() {
53         return cpdId;
54     }
55
56     /**
57      * @param cpdId the identifier of the connection point of the port (may be null)
58      */
59     public void setCpdId(String cpdId) {
60         this.cpdId = cpdId;
61     }
62
63     /**
64      * @return the identifier of the external connection point of the port (may be null)
65      */
66     public String getEcpdId() {
67         return ecpdId;
68     }
69
70     /**
71      * @param ecpdId the identifier of the connection point of the port (may be null)
72      */
73     public void setEcpdId(String ecpdId) {
74         this.ecpdId = ecpdId;
75     }
76
77     /**
78      * @return the identifier of the connection point instance of the port
79      */
80     public String getCpId() {
81         return cpId;
82     }
83
84     /**
85      * @param cpId the identifier of the connection point instance of the port
86      */
87     public void setCpId(String cpId) {
88         this.cpId = cpId;
89     }
90
91     /**
92      * @return the identifier of the tenant owning the port
93      */
94     public String getTenantId() {
95         return tenantId;
96     }
97
98     /**
99      * @param tenantId the identifier of the tenant owning the port
100      */
101     public void setTenantId(String tenantId) {
102         this.tenantId = tenantId;
103     }
104
105     /**
106      * @return the IP address of the port (may be null)
107      */
108     public String getIpAddress() {
109         return ipAddress;
110     }
111
112     /**
113      * @param ipAddress the IP address of the port (may be null)
114      */
115     public void setIpAddress(String ipAddress) {
116         this.ipAddress = ipAddress;
117     }
118
119     /**
120      * @return the MAC address of the port
121      */
122     public String getMacAddress() {
123         return macAddress;
124     }
125
126     /**
127      * @param macAddress the MAC address of the port
128      */
129     public void setMacAddress(String macAddress) {
130         this.macAddress = macAddress;
131     }
132
133     /**
134      * @return the provider id of the server to which the port is attached to (may be null)
135      */
136     public String getServerProviderId() {
137         return serverProviderId;
138     }
139
140     /**
141      * @param serverProviderId the provider id of the server to which the port is attached to (may be null)
142      */
143     public void setServerProviderId(String serverProviderId) {
144         this.serverProviderId = serverProviderId;
145     }
146
147     /**
148      * @return the name of the port  (may be null)
149      */
150     public String getName() {
151         return name;
152     }
153
154     /**
155      * @param name the name of the port
156      */
157     public void setName(String name) {
158         this.name = name;
159     }
160
161     /**
162      * @return the provider id of the network of the port
163      */
164     public String getNetworkProviderId() {
165         return networkProviderId;
166     }
167
168     /**
169      * @param networkProviderId the provider id of the network of the port
170      */
171     public void setNetworkProviderId(String networkProviderId) {
172         this.networkProviderId = networkProviderId;
173     }
174
175     @Override
176     public String toString() {
177         return "ReportedAffectedCp{" +
178                 "providerId='" + providerId + '\'' +
179                 ", cpdId='" + cpdId + '\'' +
180                 ", ecpdId='" + ecpdId + '\'' +
181                 ", cpId='" + cpId + '\'' +
182                 ", tenantId='" + tenantId + '\'' +
183                 ", ipAddress='" + ipAddress + '\'' +
184                 ", macAddress='" + macAddress + '\'' +
185                 ", serverProviderId='" + serverProviderId + '\'' +
186                 ", name='" + name + '\'' +
187                 ", networkProviderId='" + networkProviderId + '\'' +
188                 '}';
189     }
190
191     @Override
192     //generated code. This is the recommended way to formulate equals
193     @SuppressWarnings({"squid:S00122", "squid:S1067"})
194     public boolean equals(Object o) {
195         if (this == o) return true;
196         if (o == null || getClass() != o.getClass()) return false;
197         ReportedAffectedCp that = (ReportedAffectedCp) o;
198         return Objects.equals(providerId, that.providerId) &&
199                 Objects.equals(cpdId, that.cpdId) &&
200                 Objects.equals(ecpdId, that.ecpdId) &&
201                 Objects.equals(cpId, that.cpId) &&
202                 Objects.equals(tenantId, that.tenantId) &&
203                 Objects.equals(ipAddress, that.ipAddress) &&
204                 Objects.equals(macAddress, that.macAddress) &&
205                 Objects.equals(serverProviderId, that.serverProviderId) &&
206                 Objects.equals(name, that.name) &&
207                 Objects.equals(networkProviderId, that.networkProviderId);
208     }
209
210     @Override
211     public int hashCode() {
212         return Objects.hash(providerId, cpdId, ecpdId, cpId, tenantId, ipAddress, macAddress, serverProviderId, name, networkProviderId);
213     }
214 }