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 / OrchestrationFlow.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 javax.persistence.CascadeType;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.FetchType;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.JoinColumn;
32 import javax.persistence.ManyToOne;
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 org.onap.so.db.catalog.beans.BuildingBlockDetail;
38 import com.openpojo.business.annotation.BusinessKey;
39 import uk.co.blackpepper.bowman.annotation.LinkedResource;
40
41 @Entity
42 @Table(name = "orchestration_flow_reference")
43 public class OrchestrationFlow implements Serializable {
44
45     private static final long serialVersionUID = 2457818854397870011L;
46
47     @Id
48     @Column(name = "ID")
49     @GeneratedValue(strategy = GenerationType.IDENTITY)
50     private Integer id;
51
52     @BusinessKey
53     @Column(name = "COMPOSITE_ACTION")
54     private String action;
55
56     @BusinessKey
57     @Column(name = "SEQ_NO")
58     private Integer sequenceNumber;
59
60     @BusinessKey
61     @Column(name = "FLOW_NAME")
62     private String flowName;
63
64     @BusinessKey
65     @Column(name = "FLOW_VERSION")
66     private Double flowVersion;
67
68     @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
69     @JoinColumn(name = "NB_REQ_REF_LOOKUP_ID")
70     private NorthBoundRequest northBoundRequest;
71
72     @Override
73     public String toString() {
74         return new ToStringBuilder(this).append("id", id).append("action", action)
75                 .append("sequenceNumber", sequenceNumber).append("flowName", flowName)
76                 .append("flowVersion", flowVersion).toString();
77     }
78
79     @Override
80     public boolean equals(final Object other) {
81         if (!(other instanceof OrchestrationFlow)) {
82             return false;
83         }
84         OrchestrationFlow castOther = (OrchestrationFlow) other;
85         return new EqualsBuilder().append(action, castOther.action).append(sequenceNumber, castOther.sequenceNumber)
86                 .append(flowName, castOther.flowName).append(flowVersion, castOther.flowVersion).isEquals();
87     }
88
89     @Override
90     public int hashCode() {
91         return new HashCodeBuilder().append(action).append(sequenceNumber).append(flowName).append(flowVersion)
92                 .toHashCode();
93     }
94
95     public String getAction() {
96         return action;
97     }
98
99     public void setAction(String action) {
100         this.action = action;
101     }
102
103     public Integer getSequenceNumber() {
104         return sequenceNumber;
105     }
106
107     public void setSequenceNumber(Integer sequenceNumber) {
108         this.sequenceNumber = sequenceNumber;
109     }
110
111     public String getFlowName() {
112         return flowName;
113     }
114
115     public void setFlowName(String flowName) {
116         this.flowName = flowName;
117     }
118
119     public Double getFlowVersion() {
120         return flowVersion;
121     }
122
123     public void setFlowVersion(Double flowVersion) {
124         this.flowVersion = flowVersion;
125     }
126
127     public Integer getId() {
128         return id;
129     }
130
131     public void setId(Integer id) {
132         this.id = id;
133     }
134
135     @LinkedResource
136     public NorthBoundRequest getNorthBoundRequest() {
137         return northBoundRequest;
138     }
139
140     public void setNorthBoundRequest(NorthBoundRequest northBoundRequest) {
141         this.northBoundRequest = northBoundRequest;
142     }
143 }