[SO] Release so 1.13.0 image
[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 import uk.co.blackpepper.bowman.annotation.RemoteResource;
33
34 @IdClass(ControllerSelectionReferenceId.class)
35 @Entity
36 @RemoteResource("/controllerSelectionReference")
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
62     public void setVnfType(String vnfType) {
63         this.vnfType = vnfType;
64     }
65
66     public String getControllerName() {
67         return controllerName;
68     }
69
70     public void setControllerName(String controllerName) {
71         this.controllerName = controllerName;
72     }
73
74     public String getActionCategory() {
75         return actionCategory;
76     }
77
78     public void setActionCategory(String actionCategory) {
79         this.actionCategory = actionCategory;
80     }
81
82     /**
83      * {@inheritDoc}
84      */
85     @Override
86     public String toString() {
87         return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName)
88                 .append("actionCategory", actionCategory).toString();
89     }
90
91     /**
92      * {@inheritDoc}
93      */
94     @Override
95     public boolean equals(final Object other) {
96         if (!(other instanceof ControllerSelectionReference)) {
97             return false;
98         }
99         ControllerSelectionReference castOther = (ControllerSelectionReference) other;
100         return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName)
101                 .append(actionCategory, castOther.actionCategory).isEquals();
102     }
103
104     /**
105      * {@inheritDoc}
106      */
107     @Override
108     public int hashCode() {
109         return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode();
110     }
111 }