Replaced all tabs with spaces in java and pom.xml
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / OrchestrationStatusStateTransitionDirective.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 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;
22
23 import java.io.Serializable;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.EnumType;
27 import javax.persistence.Enumerated;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.Table;
32 import org.apache.commons.lang3.builder.EqualsBuilder;
33 import org.apache.commons.lang3.builder.HashCodeBuilder;
34 import org.apache.commons.lang3.builder.ToStringBuilder;
35 import com.openpojo.business.annotation.BusinessKey;
36
37 @Entity
38 @Table(name = "orchestration_status_state_transition_directive")
39 public class OrchestrationStatusStateTransitionDirective implements Serializable {
40     private static final long serialVersionUID = -4626396955833442376L;
41
42     @Id
43     @Column(name = "id")
44     @GeneratedValue(strategy = GenerationType.IDENTITY)
45     private Integer id;
46
47     @Enumerated(EnumType.STRING)
48     @Column(name = "RESOURCE_TYPE")
49     @BusinessKey
50     private ResourceType resourceType;
51
52     @Enumerated(EnumType.STRING)
53     @Column(name = "ORCHESTRATION_STATUS")
54     @BusinessKey
55     private OrchestrationStatus orchestrationStatus;
56
57     @Enumerated(EnumType.STRING)
58     @Column(name = "TARGET_ACTION")
59     @BusinessKey
60     private OrchestrationAction targetAction;
61
62     @Enumerated(EnumType.STRING)
63     @Column(name = "FLOW_DIRECTIVE")
64     @BusinessKey
65     private OrchestrationStatusValidationDirective flowDirective;
66
67     @Override
68     public String toString() {
69         return new ToStringBuilder(this).append("id", id).append("resourceType", resourceType)
70                 .append("orchestrationStatus", orchestrationStatus).append("targetAction", targetAction)
71                 .append("flowDirective", flowDirective).toString();
72     }
73
74     public Integer getId() {
75         return id;
76     }
77
78     public void setId(Integer id) {
79         this.id = id;
80     }
81
82     public ResourceType getResourceType() {
83         return resourceType;
84     }
85
86     public void setResourceType(ResourceType resourceType) {
87         this.resourceType = resourceType;
88     }
89
90     public OrchestrationStatus getOrchestrationStatus() {
91         return orchestrationStatus;
92     }
93
94     public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
95         this.orchestrationStatus = orchestrationStatus;
96     }
97
98     public OrchestrationAction getTargetAction() {
99         return targetAction;
100     }
101
102     public void setTargetAction(OrchestrationAction targetAction) {
103         this.targetAction = targetAction;
104     }
105
106     public OrchestrationStatusValidationDirective getFlowDirective() {
107         return flowDirective;
108     }
109
110     public void setFlowDirective(OrchestrationStatusValidationDirective flowDirective) {
111         this.flowDirective = flowDirective;
112     }
113
114     @Override
115     public boolean equals(final Object other) {
116         if (!(other instanceof OrchestrationStatusStateTransitionDirective)) {
117             return false;
118         }
119         OrchestrationStatusStateTransitionDirective castOther = (OrchestrationStatusStateTransitionDirective) other;
120         return new EqualsBuilder().append(getResourceType(), castOther.getResourceType())
121                 .append(getOrchestrationStatus(), castOther.getOrchestrationStatus())
122                 .append(getTargetAction(), castOther.getTargetAction())
123                 .append(getFlowDirective(), castOther.getFlowDirective()).isEquals();
124     }
125
126     @Override
127     public int hashCode() {
128         return new HashCodeBuilder().append(getResourceType()).append(getOrchestrationStatus())
129                 .append(getTargetAction()).append(getFlowDirective()).toHashCode();
130     }
131 }