e6ee349be62cdfac235e97f360018212781b5d73
[so.git] / mso-catalog-db / src / main / java / org / onap / so / db / catalog / beans / ControllerSelectionReferenceId.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
25 import com.openpojo.business.annotation.BusinessKey;
26 import org.apache.commons.lang3.builder.ToStringBuilder;
27 import org.apache.commons.lang3.builder.HashCodeBuilder;
28 import org.apache.commons.lang3.builder.EqualsBuilder;
29
30
31 public class ControllerSelectionReferenceId implements Serializable {
32
33         private static final long serialVersionUID = 1L;
34         @BusinessKey
35         private String vnfType;
36         @BusinessKey
37     private String controllerName;
38         @BusinessKey
39     private String actionCategory;
40
41         
42         @Override
43         public boolean equals(final Object other) {
44                 if (!(other instanceof ControllerSelectionReferenceId)) {
45                         return false;
46                 }
47                 ControllerSelectionReferenceId castOther = (ControllerSelectionReferenceId) other;
48                 return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName)
49                                 .append(actionCategory, castOther.actionCategory).isEquals();
50         }
51         
52         @Override
53         public int hashCode() {
54                 return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode();
55         }
56
57         @Override
58         public String toString() {
59                 return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName)
60                                 .append("actionCategory", actionCategory).toString();
61         }
62         
63         public String getVnfType() {
64                 return vnfType;
65         }
66         public void setVnfType(String vnfType) {
67                 this.vnfType = vnfType;
68         }
69         public String getControllerName() {
70                 return controllerName;
71         }
72         public void setControllerName(String controllerName) {
73                 this.controllerName = controllerName;
74         }
75         public String getActionCategory() {
76                 return actionCategory;
77         }
78         public void setActionCategory(String actionCategory) {
79                 this.actionCategory = actionCategory;
80         }       
81         
82
83 }