Springboot 2.0 upgrade
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / macro / NorthBoundRequest.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 import java.util.List;
25
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.FetchType;
30 import javax.persistence.GeneratedValue;
31 import javax.persistence.GenerationType;
32 import javax.persistence.Id;
33 import javax.persistence.OneToMany;
34 import javax.persistence.Table;
35
36 import org.apache.commons.lang3.builder.EqualsBuilder;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.ToStringBuilder;
39
40 import com.openpojo.business.annotation.BusinessKey;
41
42 import uk.co.blackpepper.bowman.annotation.LinkedResource;
43
44 @Entity
45 @Table(name = "northbound_request_ref_lookup")
46 public class NorthBoundRequest implements Serializable {
47
48         /**
49          * 
50          */
51         private static final long serialVersionUID = -2238991039015148725L;
52
53         @Id
54         @Column(name = "id")
55         @GeneratedValue(strategy = GenerationType.IDENTITY)
56         private Integer id;
57
58         @BusinessKey
59         @Column(name = "MACRO_ACTION")
60         private String macroAction;
61
62         @BusinessKey
63         @Column(name = "ACTION")
64         private String action;
65
66         @BusinessKey
67         @Column(name = "REQUEST_SCOPE")
68         private String requestScope;
69
70         @BusinessKey
71         @Column(name = "IS_ALACARTE")
72         private Boolean isAlacarte;
73
74         @BusinessKey
75         @Column(name = "IS_TOPLEVELFLOW")
76         private Boolean isToplevelflow;
77
78         @BusinessKey
79         @Column(name = "MIN_API_VERSION")
80         private Double minApiVersion;
81
82         @BusinessKey
83         @Column(name = "MAX_API_VERSION")
84         private Double maxApiVersion;
85
86         @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest")
87         private List<OrchestrationFlow> orchestrationFlowList;
88
89         @Override
90         public String toString() {
91                 return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope)
92                                 .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow)
93                                 .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion).toString();
94         }
95
96         @Override
97         public boolean equals(final Object other) {
98                 if (!(other instanceof NorthBoundRequest)) {
99                         return false;
100                 }
101                 NorthBoundRequest castOther = (NorthBoundRequest) other;
102                 return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope)
103                                 .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow)
104                                 .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion)
105                                 .isEquals();
106         }
107
108         @Override
109         public int hashCode() {
110                 return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow)
111                                 .append(minApiVersion).append(maxApiVersion).toHashCode();
112         }
113
114         public Integer getId() {
115                 return id;
116         }
117
118         public void setId(Integer id) {
119                 this.id = id;
120         }
121
122         public String getAction() {
123                 return action;
124         }
125
126         public void setAction(String action) {
127                 this.action = action;
128         }
129
130         public String getMacroAction() {
131                 return macroAction;
132         }
133
134         public void setMacroAction(String macroAction) {
135                 this.macroAction = macroAction;
136         }
137
138         public String getRequestScope() {
139                 return requestScope;
140         }
141
142         public void setRequestScope(String requestScope) {
143                 this.requestScope = requestScope;
144         }
145
146         public Boolean getIsAlacarte() {
147                 return isAlacarte;
148         }
149
150         public void setIsAlacarte(Boolean isAlacarte) {
151                 this.isAlacarte = isAlacarte;
152         }
153
154         public Boolean getIsToplevelflow() {
155                 return isToplevelflow;
156         }
157
158         public void setIsToplevelflow(Boolean isToplevelflow) {
159                 this.isToplevelflow = isToplevelflow;
160         }
161
162         public Double getMinApiVersion() {
163                 return minApiVersion;
164         }
165
166         public void setMinApiVersion(Double minApiVersion) {
167                 this.minApiVersion = minApiVersion;
168         }
169
170         public Double getMaxApiVersion() {
171                 return maxApiVersion;
172         }
173
174         public void setMaxApiVersion(Double maxApiVersion) {
175                 this.maxApiVersion = maxApiVersion;
176         }
177
178         @LinkedResource
179         public List<OrchestrationFlow> getOrchestrationFlowList() {
180                 return orchestrationFlowList;
181         }
182
183         public void setOrchestrationFlowList(List<OrchestrationFlow> orchestrationFlowList) {
184                 this.orchestrationFlowList = orchestrationFlowList;
185         }
186 }