Non-functional changes to silence Sonar
[portal/ric-dashboard.git] / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / model / RanDetailsTransport.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 AT&T Intellectual Property and Nokia
6  * %%
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ========================LICENSE_END===================================
19  */
20
21 package org.oransc.ric.portal.dashboard.model;
22
23 import org.oransc.ric.e2mgr.client.model.GetNodebResponse;
24 import org.oransc.ric.e2mgr.client.model.NodebIdentity;
25
26 public class RanDetailsTransport {
27
28         private NodebIdentity nodebIdentity;
29         private GetNodebResponse nodebStatus;
30
31         public RanDetailsTransport() {
32         }
33
34         public RanDetailsTransport(NodebIdentity nodebIdentity, GetNodebResponse nodebResponse) {
35                 this.nodebIdentity = nodebIdentity;
36                 this.nodebStatus = nodebResponse;
37         }
38
39         public NodebIdentity getNodebIdentity() {
40                 return nodebIdentity;
41         }
42
43         public void setNodebIdentity(NodebIdentity nodebIdentity) {
44                 this.nodebIdentity = nodebIdentity;
45         }
46
47         public GetNodebResponse getNodebStatus() {
48                 return nodebStatus;
49         }
50
51         public void setNodebStatus(GetNodebResponse nodebStatus) {
52                 this.nodebStatus = nodebStatus;
53         }
54
55         public RanDetailsTransport nodebIdentity(NodebIdentity n) {
56                 this.nodebIdentity = n;
57                 return this;
58         }
59
60         public RanDetailsTransport nodebStatus(GetNodebResponse s) {
61                 this.nodebStatus = s;
62                 return this;
63         }
64
65         @Override
66         public int hashCode() {
67                 final int prime = 31;
68                 int result = 1;
69                 result = prime * result + ((nodebIdentity == null) ? 0 : nodebIdentity.hashCode());
70                 result = prime * result + ((nodebStatus == null) ? 0 : nodebStatus.hashCode());
71                 return result;
72         }
73
74         @Override
75         public boolean equals(Object obj) {
76                 if (this == obj)
77                         return true;
78                 if (obj == null)
79                         return false;
80                 if (getClass() != obj.getClass())
81                         return false;
82                 RanDetailsTransport other = (RanDetailsTransport) obj;
83                 if (nodebIdentity == null) {
84                         if (other.nodebIdentity != null)
85                                 return false;
86                 } else if (!nodebIdentity.equals(other.nodebIdentity)) {
87                         return false;
88                 }
89                 if (nodebStatus == null) {
90                         if (other.nodebStatus != null)
91                                 return false;
92                 } else if (!nodebStatus.equals(other.nodebStatus)) {
93                         return false;
94                 }
95                 return true;
96         }
97
98 }