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
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.monitoring.model;
22 import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
25 * @author waqas.ikram@ericsson.com
27 public class SoInfraRequest {
29 private final String requestId;
30 private final String serviceInstanceId;
31 private final String serviceIstanceName;
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;
38 public SoInfraRequest(final SoInfraRequestBuilder requestBuilder) {
39 this.requestId = requestBuilder.getRequestId();
40 this.serviceInstanceId = requestBuilder.getServiceInstanceId();
41 this.serviceIstanceName = requestBuilder.getServiceIstanceName();
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();
50 * @return the requestId
52 public String getRequestId() {
57 * @return the serviceInstanceId
59 public String getServiceInstanceId() {
60 return serviceInstanceId;
64 * @return the serviceIstanceName
66 public String getServiceIstanceName() {
67 return serviceIstanceName;
71 * @return the networkId
73 public String getNetworkId() {
78 * @return the requestStatus
80 public String getRequestStatus() {
85 * @return the serviceType
87 public String getServiceType() {
92 * @return the startTime
94 public String getStartTime() {
101 public String getEndTime() {
106 public int hashCode() {
107 final int prime = 31;
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 + ((serviceIstanceName == null) ? 0 : serviceIstanceName.hashCode());
115 result = prime * result + ((serviceType == null) ? 0 : serviceType.hashCode());
116 result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());
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(serviceIstanceName, other.serviceIstanceName) && isEqual(networkId, other.networkId)
126 && isEqual(requestStatus, other.requestStatus) && isEqual(serviceType, other.serviceType)
127 && isEqual(startTime, other.startTime) && isEqual(endTime, other.endTime);