2 * ============LICENSE_START=======================================================
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
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;
23 import java.io.Serializable;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.EnumType;
28 import javax.persistence.Enumerated;
29 import javax.persistence.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 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;
38 import com.openpojo.business.annotation.BusinessKey;
41 @Table(name = "orchestration_status_state_transition_directive")
42 public class OrchestrationStatusStateTransitionDirective implements Serializable {
43 private static final long serialVersionUID = -4626396955833442376L;
47 @GeneratedValue(strategy = GenerationType.IDENTITY)
50 @Enumerated(EnumType.STRING)
51 @Column(name = "RESOURCE_TYPE")
53 private ResourceType resourceType;
55 @Enumerated(EnumType.STRING)
56 @Column(name = "ORCHESTRATION_STATUS")
58 private OrchestrationStatus orchestrationStatus;
60 @Enumerated(EnumType.STRING)
61 @Column(name = "TARGET_ACTION")
63 private OrchestrationAction targetAction;
65 @Enumerated(EnumType.STRING)
66 @Column(name = "FLOW_DIRECTIVE")
68 private OrchestrationStatusValidationDirective flowDirective;
71 public String toString() {
72 return new ToStringBuilder(this).append("id", id).append("resourceType", resourceType)
73 .append("orchestrationStatus", orchestrationStatus).append("targetAction", targetAction)
74 .append("flowDirective", flowDirective).toString();
77 public Integer getId() {
81 public void setId(Integer id) {
85 public ResourceType getResourceType() {
89 public void setResourceType(ResourceType resourceType) {
90 this.resourceType = resourceType;
93 public OrchestrationStatus getOrchestrationStatus() {
94 return orchestrationStatus;
97 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
98 this.orchestrationStatus = orchestrationStatus;
101 public OrchestrationAction getTargetAction() {
105 public void setTargetAction(OrchestrationAction targetAction) {
106 this.targetAction = targetAction;
109 public OrchestrationStatusValidationDirective getFlowDirective() {
110 return flowDirective;
113 public void setFlowDirective(OrchestrationStatusValidationDirective flowDirective) {
114 this.flowDirective = flowDirective;
118 public boolean equals(final Object other) {
119 if (!(other instanceof OrchestrationStatusStateTransitionDirective)) {
122 OrchestrationStatusStateTransitionDirective castOther = (OrchestrationStatusStateTransitionDirective) other;
123 return new EqualsBuilder().append(getResourceType(), castOther.getResourceType())
124 .append(getOrchestrationStatus(), castOther.getOrchestrationStatus())
125 .append(getTargetAction(), castOther.getTargetAction())
126 .append(getFlowDirective(), castOther.getFlowDirective()).isEquals();
130 public int hashCode() {
131 return new HashCodeBuilder().append(getResourceType()).append(getOrchestrationStatus())
132 .append(getTargetAction()).append(getFlowDirective()).toHashCode();