Replaced all tabs with spaces in java and pom.xml
[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 java.util.List;
25 import javax.persistence.CascadeType;
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.EnumType;
29 import javax.persistence.Enumerated;
30 import javax.persistence.FetchType;
31 import javax.persistence.GeneratedValue;
32 import javax.persistence.GenerationType;
33 import javax.persistence.Id;
34 import javax.persistence.OneToMany;
35 import javax.persistence.Table;
36 import org.apache.commons.lang3.builder.EqualsBuilder;
37 import org.apache.commons.lang3.builder.HashCodeBuilder;
38 import org.apache.commons.lang3.builder.ToStringBuilder;
39 import org.onap.so.db.catalog.beans.macro.OrchestrationFlow;
40 import com.openpojo.business.annotation.BusinessKey;
41
42 @Entity
43 @Table(name = "building_block_detail")
44 public class BuildingBlockDetail implements Serializable {
45     private static final long serialVersionUID = -2375223199178059155L;
46
47     @Id
48     @Column(name = "id")
49     @GeneratedValue(strategy = GenerationType.IDENTITY)
50     private Integer id;
51
52     @BusinessKey
53     @Column(name = "BUILDING_BLOCK_NAME")
54     private String buildingBlockName;
55
56     @Enumerated(EnumType.STRING)
57     @Column(name = "RESOURCE_TYPE")
58     private ResourceType resourceType;
59
60     @Enumerated(EnumType.STRING)
61     @Column(name = "TARGET_ACTION")
62     private OrchestrationAction targetAction;
63
64     @Override
65     public String toString() {
66         return new ToStringBuilder(this).append("buildingBlockName", buildingBlockName)
67                 .append("resourceType", resourceType).append("targetAction", targetAction).toString();
68     }
69
70     @Override
71     public boolean equals(final Object other) {
72         if (!(other instanceof BuildingBlockDetail)) {
73             return false;
74         }
75         BuildingBlockDetail castOther = (BuildingBlockDetail) other;
76         return new EqualsBuilder().append(buildingBlockName, castOther.buildingBlockName).isEquals();
77     }
78
79     @Override
80     public int hashCode() {
81         return new HashCodeBuilder().append(buildingBlockName).toHashCode();
82     }
83
84     public Integer getId() {
85         return id;
86     }
87
88     public void setId(Integer id) {
89         this.id = id;
90     }
91
92     public String getBuildingBlockName() {
93         return buildingBlockName;
94     }
95
96     public void setBuildingBlockName(String buildingBlockName) {
97         this.buildingBlockName = buildingBlockName;
98     }
99
100     public ResourceType getResourceType() {
101         return resourceType;
102     }
103
104     public void setResourceType(ResourceType resourceType) {
105         this.resourceType = resourceType;
106     }
107
108     public OrchestrationAction getTargetAction() {
109         return targetAction;
110     }
111
112     public void setTargetAction(OrchestrationAction targetAction) {
113         this.targetAction = targetAction;
114     }
115 }