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;
36 import uk.co.blackpepper.bowman.annotation.RemoteResource;
39 @RemoteResource("/buildingBlockDetail")
40 @Table(name = "building_block_detail")
41 public class BuildingBlockDetail implements Serializable {
42 private static final long serialVersionUID = -2375223199178059155L;
46 @GeneratedValue(strategy = GenerationType.IDENTITY)
50 @Column(name = "BUILDING_BLOCK_NAME")
51 private String buildingBlockName;
53 @Enumerated(EnumType.STRING)
54 @Column(name = "RESOURCE_TYPE")
55 private ResourceType resourceType;
57 @Enumerated(EnumType.STRING)
58 @Column(name = "TARGET_ACTION")
59 private OrchestrationAction targetAction;
62 public String toString() {
63 return new ToStringBuilder(this).append("buildingBlockName", buildingBlockName)
64 .append("resourceType", resourceType).append("targetAction", targetAction).toString();
68 public boolean equals(final Object other) {
69 if (!(other instanceof BuildingBlockDetail)) {
72 BuildingBlockDetail castOther = (BuildingBlockDetail) other;
73 return new EqualsBuilder().append(buildingBlockName, castOther.buildingBlockName).isEquals();
77 public int hashCode() {
78 return new HashCodeBuilder().append(buildingBlockName).toHashCode();
81 public Integer getId() {
85 public void setId(Integer id) {
89 public String getBuildingBlockName() {
90 return buildingBlockName;
93 public void setBuildingBlockName(String buildingBlockName) {
94 this.buildingBlockName = buildingBlockName;
97 public ResourceType getResourceType() {
101 public void setResourceType(ResourceType resourceType) {
102 this.resourceType = resourceType;
105 public OrchestrationAction getTargetAction() {
109 public void setTargetAction(OrchestrationAction targetAction) {
110 this.targetAction = targetAction;