[SO] Release so 1.13.0 image
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / BuildingBlockDetail.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 import uk.co.blackpepper.bowman.annotation.RemoteResource;
37
38 @Entity
39 @RemoteResource("/buildingBlockDetail")
40 @Table(name = "building_block_detail")
41 public class BuildingBlockDetail implements Serializable {
42     private static final long serialVersionUID = -2375223199178059155L;
43
44     @Id
45     @Column(name = "id")
46     @GeneratedValue(strategy = GenerationType.IDENTITY)
47     private Integer id;
48
49     @BusinessKey
50     @Column(name = "BUILDING_BLOCK_NAME")
51     private String buildingBlockName;
52
53     @Enumerated(EnumType.STRING)
54     @Column(name = "RESOURCE_TYPE")
55     private ResourceType resourceType;
56
57     @Enumerated(EnumType.STRING)
58     @Column(name = "TARGET_ACTION")
59     private OrchestrationAction targetAction;
60
61     @Override
62     public String toString() {
63         return new ToStringBuilder(this).append("buildingBlockName", buildingBlockName)
64                 .append("resourceType", resourceType).append("targetAction", targetAction).toString();
65     }
66
67     @Override
68     public boolean equals(final Object other) {
69         if (!(other instanceof BuildingBlockDetail)) {
70             return false;
71         }
72         BuildingBlockDetail castOther = (BuildingBlockDetail) other;
73         return new EqualsBuilder().append(buildingBlockName, castOther.buildingBlockName).isEquals();
74     }
75
76     @Override
77     public int hashCode() {
78         return new HashCodeBuilder().append(buildingBlockName).toHashCode();
79     }
80
81     public Integer getId() {
82         return id;
83     }
84
85     public void setId(Integer id) {
86         this.id = id;
87     }
88
89     public String getBuildingBlockName() {
90         return buildingBlockName;
91     }
92
93     public void setBuildingBlockName(String buildingBlockName) {
94         this.buildingBlockName = buildingBlockName;
95     }
96
97     public ResourceType getResourceType() {
98         return resourceType;
99     }
100
101     public void setResourceType(ResourceType resourceType) {
102         this.resourceType = resourceType;
103     }
104
105     public OrchestrationAction getTargetAction() {
106         return targetAction;
107     }
108
109     public void setTargetAction(OrchestrationAction targetAction) {
110         this.targetAction = targetAction;
111     }
112 }