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