2ef0bde468dbf26639e4113b3b02780f6968cd1a
[policy/drools-applications.git] / controlloop / common / model-impl / aai / src / main / java / org / onap / policy / aai / Pnf.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * aai
4  * ================================================================================
5  * Copyright (C) 2017 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.policy.aai;
22
23 import java.io.Serializable;
24
25 public class Pnf implements Serializable {
26     private static final long serialVersionUID = -3535108358668248501L;
27
28     private String pnfName;
29     private PnfType pnfType;
30
31     public Pnf() {
32
33     }
34
35     public Pnf(Pnf pnf) {
36         this.pnfName = pnf.pnfName;
37         this.pnfType = pnf.pnfType;
38     }
39
40     public String getPnfName() {
41         return pnfName;
42     }
43
44     public void setPnfName(String pnfName) {
45         this.pnfName = pnfName;
46     }
47
48     public PnfType getPnfType() {
49         return pnfType;
50     }
51
52     public void setPnfType(PnfType pnfType) {
53         this.pnfType = pnfType;
54     }
55
56     @Override
57     public String toString() {
58         return "PNF [PNFName=" + pnfName + ", PNFType=" + pnfType + "]";
59     }
60
61     @Override
62     public int hashCode() {
63         final int prime = 31;
64         int result = 1;
65         result = prime * result + ((pnfName == null) ? 0 : pnfName.hashCode());
66         result = prime * result + ((pnfType == null) ? 0 : pnfType.hashCode());
67         return result;
68     }
69
70     @Override
71     public boolean equals(Object obj) {
72         if (this == obj) {
73             return true;
74         }
75         if (obj == null) {
76             return false;
77         }
78         if (getClass() != obj.getClass()) {
79             return false;
80         }
81         Pnf other = (Pnf) obj;
82         if (pnfName == null) {
83             if (other.pnfName != null) {
84                 return false;
85             }
86         } else if (!pnfName.equals(other.pnfName)) {
87             return false;
88         }
89         return pnfType == other.pnfType;
90     }
91 }