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;
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;
38 @Table(name = "orchestration_status_state_transition_directive")
39 public class OrchestrationStatusStateTransitionDirective implements Serializable {
40 private static final long serialVersionUID = -4626396955833442376L;
44 @GeneratedValue(strategy = GenerationType.IDENTITY)
47 @Enumerated(EnumType.STRING)
48 @Column(name = "RESOURCE_TYPE")
50 private ResourceType resourceType;
52 @Enumerated(EnumType.STRING)
53 @Column(name = "ORCHESTRATION_STATUS")
55 private OrchestrationStatus orchestrationStatus;
57 @Enumerated(EnumType.STRING)
58 @Column(name = "TARGET_ACTION")
60 private OrchestrationAction targetAction;
62 @Enumerated(EnumType.STRING)
63 @Column(name = "FLOW_DIRECTIVE")
65 private OrchestrationStatusValidationDirective flowDirective;
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();
74 public Integer getId() {
78 public void setId(Integer id) {
82 public ResourceType getResourceType() {
86 public void setResourceType(ResourceType resourceType) {
87 this.resourceType = resourceType;
90 public OrchestrationStatus getOrchestrationStatus() {
91 return orchestrationStatus;
94 public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
95 this.orchestrationStatus = orchestrationStatus;
98 public OrchestrationAction getTargetAction() {
102 public void setTargetAction(OrchestrationAction targetAction) {
103 this.targetAction = targetAction;
106 public OrchestrationStatusValidationDirective getFlowDirective() {
107 return flowDirective;
110 public void setFlowDirective(OrchestrationStatusValidationDirective flowDirective) {
111 this.flowDirective = flowDirective;
115 public boolean equals(final Object other) {
116 if (!(other instanceof OrchestrationStatusStateTransitionDirective)) {
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();
127 public int hashCode() {
128 return new HashCodeBuilder().append(getResourceType()).append(getOrchestrationStatus())
129 .append(getTargetAction()).append(getFlowDirective()).toHashCode();