798604e4fb558cef5480a384198b37a2e47bfc36
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / BuildingBlockRollback.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2021 Bell Canada. 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 com.fasterxml.jackson.annotation.JsonProperty;
24 import com.openpojo.business.annotation.BusinessKey;
25 import java.io.Serializable;
26 import java.util.Objects;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 import javax.persistence.Table;
33 import uk.co.blackpepper.bowman.annotation.RemoteResource;
34
35 @Entity
36 @RemoteResource("/buildingBlockRollback")
37 @Table(name = "building_block_rollback")
38 public class BuildingBlockRollback implements Serializable {
39
40     private static final long serialVersionUID = 1;
41
42     @Id
43     @BusinessKey
44     @GeneratedValue(strategy = GenerationType.IDENTITY)
45     @Column(name = "ID", nullable = false, updatable = false)
46     private Integer id;
47
48     @BusinessKey
49     @JsonProperty("building_block_name")
50     @Column(name = "BUILDING_BLOCK_NAME", nullable = false, length = 200)
51     private String buildingBlockName;
52
53     @BusinessKey
54     @JsonProperty("action")
55     @Column(name = "ACTION", length = 200)
56     private String action;
57
58     @BusinessKey
59     @JsonProperty("rollback_building_block_name")
60     @Column(name = "ROLLBACK_BUILDING_BLOCK_NAME", nullable = false, length = 200)
61     private String rollbackBuildingBlockName;
62
63     @BusinessKey
64     @JsonProperty("rollback_action")
65     @Column(name = "ROLLBACK_ACTION", length = 200)
66     private String rollbackAction;
67
68     public Integer getId() {
69         return id;
70     }
71
72     public void setId(Integer id) {
73         this.id = id;
74     }
75
76     public String getBuildingBlockName() {
77         return buildingBlockName;
78     }
79
80     public void setBuildingBlockName(String buildingBlockName) {
81         this.buildingBlockName = buildingBlockName;
82     }
83
84     public String getAction() {
85         return action;
86     }
87
88     public void setAction(String action) {
89         this.action = action;
90     }
91
92     public String getRollbackBuildingBlockName() {
93         return rollbackBuildingBlockName;
94     }
95
96     public void setRollbackBuildingBlockName(String rollbackBuildingBlockName) {
97         this.rollbackBuildingBlockName = rollbackBuildingBlockName;
98     }
99
100     public String getRollbackAction() {
101         return rollbackAction;
102     }
103
104     public void setRollbackAction(String rollbackAction) {
105         this.rollbackAction = rollbackAction;
106     }
107
108     @Override
109     public boolean equals(Object o) {
110         if (this == o) {
111             return true;
112         }
113         if (o == null || getClass() != o.getClass()) {
114             return false;
115         }
116         BuildingBlockRollback that = (BuildingBlockRollback) o;
117         return id.equals(that.id) && buildingBlockName.equals(that.buildingBlockName)
118                 && Objects.equals(action, that.action)
119                 && rollbackBuildingBlockName.equals(that.rollbackBuildingBlockName)
120                 && Objects.equals(rollbackAction, that.rollbackAction);
121     }
122
123     @Override
124     public int hashCode() {
125         return Objects.hash(id, buildingBlockName, action, rollbackBuildingBlockName, rollbackAction);
126     }
127
128     @Override
129     public String toString() {
130         return "BuildingBlockRollback{" + "id='" + id + '\'' + ", buildingBlockName='" + buildingBlockName + '\''
131                 + ", action='" + action + '\'' + ", rollbackBuildingBlockName='" + rollbackBuildingBlockName + '\''
132                 + ", rollbackAction='" + rollbackAction + '\'' + '}';
133     }
134 }