d07788e55c13d6b0a667eaaac30e712f49337479
[so.git] / mso-api-handlers / mso-requests-db / src / main / java / org / onap / so / db / request / beans / OperationStatusId.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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.onap.so.db.request.beans;
22
23 import java.io.Serializable;
24 import java.util.Objects;
25
26 import com.openpojo.business.annotation.BusinessKey;
27 import org.apache.commons.lang3.builder.ToStringBuilder;
28
29 public class OperationStatusId implements Serializable {
30
31         private static final long serialVersionUID = 3114959241155882723L;
32         
33         @BusinessKey
34         private String serviceId;
35         @BusinessKey
36         private String operationId;
37         
38         public OperationStatusId() {
39                 
40         }
41         public OperationStatusId(String serviceId, String operationId) {
42                 this.serviceId = serviceId;
43                 this.operationId = operationId;
44         }
45         public String getServiceId() {
46                 return serviceId;
47         }
48         public void setServiceId(String serviceId) {
49                 this.serviceId = serviceId;
50         }
51         public String getOperationId() {
52                 return operationId;
53         }
54         public void setOperationId(String operationId) {
55                 this.operationId = operationId;
56         }
57         @Override
58         public boolean equals(final Object other) {
59                 if (this == other) {
60                         return true;
61                 }
62                 if (!(other instanceof OperationStatusId)) {
63                         return false;
64                 }
65                 OperationStatusId castOther = (OperationStatusId) other;
66                 return Objects.equals(this.getServiceId(), castOther.getServiceId())
67                                 && Objects.equals(this.getOperationId(), castOther.getOperationId());
68         }
69         @Override
70         public int hashCode() {
71                 return Objects.hash(this.getServiceId(), this.getOperationId());
72         }
73         @Override
74         public String toString() {
75                 return new ToStringBuilder(this).append("serviceId", getServiceId()).append("operationId", getOperationId())
76                                 .toString();
77         }
78
79 }