2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.so.db.catalog.beans.macro;
23 import java.io.Serializable;
24 import java.util.List;
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.Id;
32 import javax.persistence.OneToMany;
33 import javax.persistence.Table;
35 import org.apache.commons.lang3.builder.EqualsBuilder;
36 import org.apache.commons.lang3.builder.HashCodeBuilder;
37 import org.apache.commons.lang3.builder.ToStringBuilder;
39 import com.openpojo.business.annotation.BusinessKey;
41 import uk.co.blackpepper.bowman.annotation.LinkedResource;
44 @Table(name = "northbound_request_ref_lookup")
45 public class NorthBoundRequest implements Serializable {
50 private static final long serialVersionUID = -2238991039015148725L;
58 @Column(name = "MACRO_ACTION")
59 private String macroAction;
62 @Column(name = "ACTION")
63 private String action;
66 @Column(name = "REQUEST_SCOPE")
67 private String requestScope;
70 @Column(name = "IS_ALACARTE")
71 private Boolean isAlacarte;
74 @Column(name = "IS_TOPLEVELFLOW")
75 private Boolean isToplevelflow;
78 @Column(name = "MIN_API_VERSION")
79 private Double minApiVersion;
82 @Column(name = "MAX_API_VERSION")
83 private Double maxApiVersion;
85 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest")
86 private List<OrchestrationFlow> orchestrationFlowList;
89 public String toString() {
90 return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope)
91 .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow)
92 .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion).toString();
96 public boolean equals(final Object other) {
97 if (!(other instanceof NorthBoundRequest)) {
100 NorthBoundRequest castOther = (NorthBoundRequest) other;
101 return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope)
102 .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow)
103 .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion)
108 public int hashCode() {
109 return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow)
110 .append(minApiVersion).append(maxApiVersion).toHashCode();
113 public Integer getId() {
117 public void setId(Integer id) {
121 public String getAction() {
125 public void setAction(String action) {
126 this.action = action;
129 public String getMacroAction() {
133 public void setMacroAction(String macroAction) {
134 this.macroAction = macroAction;
137 public String getRequestScope() {
141 public void setRequestScope(String requestScope) {
142 this.requestScope = requestScope;
145 public Boolean getIsAlacarte() {
149 public void setIsAlacarte(Boolean isAlacarte) {
150 this.isAlacarte = isAlacarte;
153 public Boolean getIsToplevelflow() {
154 return isToplevelflow;
157 public void setIsToplevelflow(Boolean isToplevelflow) {
158 this.isToplevelflow = isToplevelflow;
161 public Double getMinApiVersion() {
162 return minApiVersion;
165 public void setMinApiVersion(Double minApiVersion) {
166 this.minApiVersion = minApiVersion;
169 public Double getMaxApiVersion() {
170 return maxApiVersion;
173 public void setMaxApiVersion(Double maxApiVersion) {
174 this.maxApiVersion = maxApiVersion;
178 public List<OrchestrationFlow> getOrchestrationFlowList() {
179 return orchestrationFlowList;
182 public void setOrchestrationFlowList(List<OrchestrationFlow> orchestrationFlowList) {
183 this.orchestrationFlowList = orchestrationFlowList;