Remove mso-oof-adapter from SO
[so.git] / so-monitoring / so-monitoring-handler / src / main / java / org / onap / so / monitoring / model / SoInfraRequest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2018 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.monitoring.model;
21
22 import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
23
24 /**
25  * @author waqas.ikram@ericsson.com
26  */
27 public class SoInfraRequest {
28
29     private final String requestId;
30     private final String serviceInstanceId;
31     private final String serviceInstanceName;
32     private final String networkId;
33     private final String requestStatus;
34     private final String serviceType;
35     private final String startTime;
36     private final String endTime;
37
38     public SoInfraRequest(final SoInfraRequestBuilder requestBuilder) {
39         this.requestId = requestBuilder.getRequestId();
40         this.serviceInstanceId = requestBuilder.getServiceInstanceId();
41         this.serviceInstanceName = requestBuilder.getServiceInstanceName();
42         this.networkId = requestBuilder.getNetworkId();
43         this.requestStatus = requestBuilder.getRequestStatus();
44         this.serviceType = requestBuilder.getServiceType();
45         this.startTime = requestBuilder.getStartTime();
46         this.endTime = requestBuilder.getEndTime();
47     }
48
49     /**
50      * @return the requestId
51      */
52     public String getRequestId() {
53         return requestId;
54     }
55
56     /**
57      * @return the serviceInstanceId
58      */
59     public String getServiceInstanceId() {
60         return serviceInstanceId;
61     }
62
63     /**
64      * @return the serviceInstanceName
65      */
66     public String getServiceInstanceName() {
67         return serviceInstanceName;
68     }
69
70     /**
71      * @return the networkId
72      */
73     public String getNetworkId() {
74         return networkId;
75     }
76
77     /**
78      * @return the requestStatus
79      */
80     public String getRequestStatus() {
81         return requestStatus;
82     }
83
84     /**
85      * @return the serviceType
86      */
87     public String getServiceType() {
88         return serviceType;
89     }
90
91     /**
92      * @return the startTime
93      */
94     public String getStartTime() {
95         return startTime;
96     }
97
98     /**
99      * @return the endTime
100      */
101     public String getEndTime() {
102         return endTime;
103     }
104
105     @Override
106     public int hashCode() {
107         final int prime = 31;
108         int result = 1;
109         result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());
110         result = prime * result + ((networkId == null) ? 0 : networkId.hashCode());
111         result = prime * result + ((requestId == null) ? 0 : requestId.hashCode());
112         result = prime * result + ((requestStatus == null) ? 0 : requestStatus.hashCode());
113         result = prime * result + ((serviceInstanceId == null) ? 0 : serviceInstanceId.hashCode());
114         result = prime * result + ((serviceInstanceName == null) ? 0 : serviceInstanceName.hashCode());
115         result = prime * result + ((serviceType == null) ? 0 : serviceType.hashCode());
116         result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());
117         return result;
118     }
119
120     @Override
121     public boolean equals(final Object obj) {
122         if (obj instanceof SoInfraRequest) {
123             final SoInfraRequest other = (SoInfraRequest) obj;
124             return isEqual(requestId, other.requestId) && isEqual(serviceInstanceId, other.serviceInstanceId)
125                     && isEqual(serviceInstanceName, other.serviceInstanceName) && isEqual(networkId, other.networkId)
126                     && isEqual(requestStatus, other.requestStatus) && isEqual(serviceType, other.serviceType)
127                     && isEqual(startTime, other.startTime) && isEqual(endTime, other.endTime);
128         }
129         return false;
130     }
131
132 }