f341c4cb5c9dc7a4cb9152dd252724621a4f7244
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / macro / RainyDayHandlerStatus.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.catalog.beans.macro;
22
23 import java.io.Serializable;
24
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.GeneratedValue;
28 import javax.persistence.Id;
29 import javax.persistence.Table;
30
31 import org.apache.commons.lang3.builder.EqualsBuilder;
32 import org.apache.commons.lang3.builder.HashCodeBuilder;
33 import org.apache.commons.lang3.builder.ToStringBuilder;
34
35 import com.openpojo.business.annotation.BusinessKey;
36
37 @Entity
38 @Table(name = "rainy_day_handler_macro")
39 public class RainyDayHandlerStatus implements Serializable {
40
41         /**
42          * 
43          */
44         private static final long serialVersionUID = 1L;
45
46         @Id
47         @Column(name = "id")
48         @GeneratedValue
49         private Integer id;
50
51         @BusinessKey
52         @Column(name = "FLOW_NAME")
53         private String flowName;
54
55         @BusinessKey
56         @Column(name = "SERVICE_TYPE")
57         private String serviceType;
58
59         @BusinessKey
60         @Column(name = "VNF_TYPE")
61         private String vnfType;
62
63         @BusinessKey
64         @Column(name = "ERROR_CODE")
65         private String errorCode;
66
67         @BusinessKey
68         @Column(name = "WORK_STEP")
69         private String workStep;
70
71         @BusinessKey
72         @Column(name = "POLICY")
73         private String policy;
74
75         @Override
76         public String toString() {
77                 return new ToStringBuilder(this).append("id", id).append("flowName", flowName)
78                                 .append("serviceType", serviceType).append("vnfType", vnfType).append("errorCode", errorCode)
79                                 .append("workStep", workStep).append("policy", policy).toString();
80         }
81
82         @Override
83         public boolean equals(final Object other) {
84                 if (!(other instanceof RainyDayHandlerStatus)) {
85                         return false;
86                 }
87                 RainyDayHandlerStatus castOther = (RainyDayHandlerStatus) other;
88                 return new EqualsBuilder().append(flowName, castOther.flowName).append(serviceType, castOther.serviceType)
89                                 .append(vnfType, castOther.vnfType).append(errorCode, castOther.errorCode)
90                                 .append(workStep, castOther.workStep).append(policy, castOther.policy).isEquals();
91         }
92
93         @Override
94         public int hashCode() {
95                 return new HashCodeBuilder().append(flowName).append(serviceType).append(vnfType).append(errorCode)
96                                 .append(workStep).append(policy).toHashCode();
97         }
98
99         public Integer getId() {
100                 return id;
101         }
102
103         public void setId(Integer id) {
104                 this.id = id;
105         }
106
107         public String getFlowName() {
108                 return flowName;
109         }
110
111         public void setFlowName(String flowName) {
112                 this.flowName = flowName;
113         }
114
115         public String getServiceType() {
116                 return serviceType;
117         }
118
119         public void setServiceType(String serviceType) {
120                 this.serviceType = serviceType;
121         }
122
123         public String getVnfType() {
124                 return vnfType;
125         }
126
127         public void setVnfType(String vnfType) {
128                 this.vnfType = vnfType;
129         }
130
131         public String getErrorCode() {
132                 return errorCode;
133         }
134
135         public void setErrorCode(String errorCode) {
136                 this.errorCode = errorCode;
137         }
138
139         public String getWorkStep() {
140                 return workStep;
141         }
142
143         public void setWorkStep(String workStep) {
144                 this.workStep = workStep;
145         }
146
147         public String getPolicy() {
148                 return policy;
149         }
150
151         public void setPolicy(String policy) {
152                 this.policy = policy;
153         }
154 }