Replaced all tabs with spaces in java and pom.xml
[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 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.Id;
26 import javax.persistence.IdClass;
27 import javax.persistence.Table;
28 import com.openpojo.business.annotation.BusinessKey;
29 import org.apache.commons.lang3.builder.ToStringBuilder;
30 import org.apache.commons.lang3.builder.HashCodeBuilder;
31 import org.apache.commons.lang3.builder.EqualsBuilder;
32
33 @IdClass(ControllerSelectionReferenceId.class)
34 @Entity
35 @Table(name = "CONTROLLER_SELECTION_REFERENCE")
36 public class ControllerSelectionReference implements Serializable {
37
38     private static final long serialVersionUID = -608098800737567188L;
39
40     @BusinessKey
41     @Id
42     @Column(name = "VNF_TYPE")
43     private String vnfType;
44
45     @BusinessKey
46     @Id
47     @Column(name = "CONTROLLER_NAME")
48     private String controllerName;
49
50     @BusinessKey
51     @Id
52     @Column(name = "ACTION_CATEGORY")
53     private String actionCategory;
54
55
56     public String getVnfType() {
57         return vnfType;
58     }
59
60     public void setVnfType(String vnfType) {
61         this.vnfType = vnfType;
62     }
63
64     public String getControllerName() {
65         return controllerName;
66     }
67
68     public void setControllerName(String controllerName) {
69         this.controllerName = controllerName;
70     }
71
72     public String getActionCategory() {
73         return actionCategory;
74     }
75
76     public void setActionCategory(String actionCategory) {
77         this.actionCategory = actionCategory;
78     }
79
80     /**
81      * {@inheritDoc}
82      */
83     @Override
84     public String toString() {
85         return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName)
86                 .append("actionCategory", actionCategory).toString();
87     }
88
89     /**
90      * {@inheritDoc}
91      */
92     @Override
93     public boolean equals(final Object other) {
94         if (!(other instanceof ControllerSelectionReference)) {
95             return false;
96         }
97         ControllerSelectionReference castOther = (ControllerSelectionReference) other;
98         return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName)
99                 .append(actionCategory, castOther.actionCategory).isEquals();
100     }
101
102     /**
103      * {@inheritDoc}
104      */
105     @Override
106     public int hashCode() {
107         return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode();
108     }
109 }