Created Ref Data tbl for controllerSelection
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / ControllerSelectionReference.java
1 package org.onap.so.db.catalog.beans;
2 /*-
3  * ============LICENSE_START=======================================================
4  * ONAP - SO
5  * ================================================================================
6  * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  * 
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  * 
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 import java.io.Serializable;
23
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.Id;
27 import javax.persistence.IdClass;
28 import javax.persistence.Table;
29
30 import com.openpojo.business.annotation.BusinessKey;
31 import org.apache.commons.lang3.builder.ToStringBuilder;
32 import org.apache.commons.lang3.builder.HashCodeBuilder;
33 import org.apache.commons.lang3.builder.EqualsBuilder;
34
35 @IdClass(ControllerSelectionReferenceId.class)
36 @Entity
37 @Table(name = "CONTROLLER_SELECTION_REFERENCE")
38 public class ControllerSelectionReference implements Serializable {
39
40         private static final long serialVersionUID = -608098800737567188L;
41         
42         @BusinessKey
43         @Id
44         @Column(name = "VNF_TYPE")
45         private String vnfType;
46         
47         @BusinessKey
48         @Id
49         @Column(name = "CONTROLLER_NAME")
50     private String controllerName;
51         
52         @BusinessKey
53         @Id
54         @Column(name = "ACTION_CATEGORY")
55     private String actionCategory;
56
57         
58         public String getVnfType() {
59                 return vnfType;
60         }
61         public void setVnfType(String vnfType) {
62                 this.vnfType = vnfType;
63         }
64         public String getControllerName() {
65                 return controllerName;
66         }
67         public void setControllerName(String controllerName) {
68                 this.controllerName = controllerName;
69         }
70         public String getActionCategory() {
71                 return actionCategory;
72         }
73         public void setActionCategory(String actionCategory) {
74                 this.actionCategory = actionCategory;
75         }       
76         
77         /**
78          * {@inheritDoc}
79          */
80         @Override
81         public String toString() {
82                 return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName)
83                                 .append("actionCategory", actionCategory).toString();
84         }
85         
86         /**
87          * {@inheritDoc}
88          */
89         @Override
90         public boolean equals(final Object other) {
91                 if (!(other instanceof ControllerSelectionReference)) {
92                         return false;
93                 }
94                 ControllerSelectionReference castOther = (ControllerSelectionReference) other;
95                 return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName)
96                                 .append(actionCategory, castOther.actionCategory).isEquals();
97         }
98         
99         /**
100          * {@inheritDoc}
101          */
102         @Override
103         public int hashCode() {
104                 return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode();
105         }
106 }