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.Id;
31 import javax.persistence.Table;
33 import org.apache.commons.lang3.builder.EqualsBuilder;
34 import org.apache.commons.lang3.builder.HashCodeBuilder;
35 import org.apache.commons.lang3.builder.ToStringBuilder;
37 import com.openpojo.business.annotation.BusinessKey;
40 @Table(name = "orchestration_status_state_transition_directive")
41 public class OrchestrationStatusStateTransitionDirective implements Serializable {
42 private static final long serialVersionUID = -4626396955833442376L;
49 @Enumerated(EnumType.STRING)
50 @Column(name = "RESOURCE_TYPE")
52 private ResourceType resourceType;
54 @Enumerated(EnumType.STRING)
55 @Column(name = "ORCHESTRATION_STATUS")
57 private OrchestrationStatus orchestrationStatus;
59 @Enumerated(EnumType.STRING)
60 @Column(name = "TARGET_ACTION")
62 private OrchestrationAction targetAction;
64 @Enumerated(EnumType.STRING)
65 @Column(name = "FLOW_DIRECTIVE")
67 private OrchestrationStatusValidationDirective flowDirective;
70 public String toString() {
71 return new ToStringBuilder(this).append("id", id).append("resourceType", resourceType)
72 .append("orchestrationStatus", orchestrationStatus).append("targetAction", targetAction)
73 .append("flowDirective", flowDirective).toString();
76 public Integer getId() {
80 public void setId(Integer id) {
84 public ResourceType getResourceType() {
88 public void setResourceType(ResourceType resourceType) {
89 this.resourceType = resourceType;
92 public OrchestrationStatus getOrchestrationStatus() {
93 return orchestrationStatus;
96 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
97 this.orchestrationStatus = orchestrationStatus;
100 public OrchestrationAction getTargetAction() {
104 public void setTargetAction(OrchestrationAction targetAction) {
105 this.targetAction = targetAction;
108 public OrchestrationStatusValidationDirective getFlowDirective() {
109 return flowDirective;
112 public void setFlowDirective(OrchestrationStatusValidationDirective flowDirective) {
113 this.flowDirective = flowDirective;
117 public boolean equals(final Object other) {
118 if (!(other instanceof OrchestrationStatusStateTransitionDirective)) {
121 OrchestrationStatusStateTransitionDirective castOther = (OrchestrationStatusStateTransitionDirective) other;
122 return new EqualsBuilder().append(getResourceType(), castOther.getResourceType())
123 .append(getOrchestrationStatus(), castOther.getOrchestrationStatus())
124 .append(getTargetAction(), castOther.getTargetAction())
125 .append(getFlowDirective(), castOther.getFlowDirective()).isEquals();
129 public int hashCode() {
130 return new HashCodeBuilder().append(getResourceType()).append(getOrchestrationStatus())
131 .append(getTargetAction()).append(getFlowDirective()).toHashCode();