Merge "Reorder modifiers"
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / NetworkResourceCustomization.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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 package org.openecomp.mso.db.catalog.beans;
21
22 import java.sql.Timestamp;
23
24 import com.openpojo.business.annotation.BusinessKey;
25
26 import java.io.Serializable;
27
28 public class NetworkResourceCustomization implements Serializable{
29
30         // modelCustomizationUuid and networkResourceModelUuid form a composite primary key
31         @BusinessKey
32         private String modelCustomizationUuid = null;
33         @BusinessKey
34         private String networkResourceModelUuid = null;
35         public static final long serialVersionUID = -1322322139926390329L;
36         private String modelInstanceName = null;
37         private Timestamp created = null;
38         private String networkTechnology = null;
39         private String networkType = null;
40         private String networkScope = null;
41         private String networkRole = null;
42
43         // These fields are not in the table directly - but I'm adding them here for storage in the objects we're dealing with
44         private NetworkResource networkResource = null;
45
46         public NetworkResourceCustomization() {
47                 super();
48         }
49
50         public String getModelCustomizationUuid() {
51                 return this.modelCustomizationUuid;
52         }
53         public void setModelCustomizationUuid(String modelCustomizationUuid) {
54                 this.modelCustomizationUuid = modelCustomizationUuid;
55         }
56
57         public String getNetworkResourceModelUuid() {
58                 return this.networkResourceModelUuid;
59         }
60         public void setNetworkResourceModelUuid(String networkResourceModelUuid) {
61                 this.networkResourceModelUuid = networkResourceModelUuid;
62         }
63
64         public String getModelInstanceName() {
65                 return  this.modelInstanceName;
66         }
67         public void setModelInstanceName(String modelInstanceName) {
68                 this.modelInstanceName = modelInstanceName;
69         }
70
71         public NetworkResource getNetworkResource() {
72                 return this.networkResource;
73         }
74         public void setNetworkResource(NetworkResource networkResource) {
75                 this.networkResource = networkResource;
76         }
77
78         public String getNetworkType() {
79                 return this.networkType;
80         }
81         public void setNetworkType(String networkType) {
82                 this.networkType = networkType;
83         }
84         public Timestamp getCreated() {
85                 return this.created;
86         }
87         public void setCreated(java.sql.Timestamp timestamp) {
88                 this.created = timestamp;
89         }
90
91         public String getNetworkTechnology() {
92                 return this.networkTechnology;
93         }
94         public void setNetworkTechnology(String networkTechnology) {
95                 this.networkTechnology = networkTechnology;
96         }
97         public String getNetworkScope() {
98                 return this.networkScope;
99         }
100         public void setNetworkScope(String networkScope) {
101                 this.networkScope = networkScope;
102         }
103         public void setNetworkRole(String networkRole) {
104                 this.networkRole = networkRole;
105         }
106         public String getNetworkRole() {
107                 return this.networkRole;
108         }
109
110         @Override
111         public String toString() {
112                 return "modelCustomizationUuid=" + this.modelCustomizationUuid +
113                         "networkResourceModelUuid=" + this.networkResourceModelUuid +
114                         "modelInstanceName=" + this.modelInstanceName +
115                         "networkType=" + this.networkType +
116                         "networkTechnology=" + this.networkTechnology +
117                         "networkScope=" + this.networkScope +
118                         "networkRole=" + this.networkRole;
119         }
120
121     @Override
122     public boolean equals (Object o) {
123         if (!(o instanceof NetworkResourceCustomization)) {
124             return false;
125         }
126         if (this == o) {
127             return true;
128         }
129         NetworkResourceCustomization nrc = (NetworkResourceCustomization) o;
130         if (nrc.getModelCustomizationUuid().equals(this.getModelCustomizationUuid()) 
131                         && nrc.getNetworkResourceModelUuid().equals(this.getNetworkResourceModelUuid())) {
132             return true;
133         }
134         return false;
135     }
136
137     @Override
138     public int hashCode () {
139         // hash code does not have to be a unique result - only that two objects that should be treated as equal
140         // return the same value. so this should work.
141         int result;
142         result = (this.modelCustomizationUuid != null ? this.modelCustomizationUuid.hashCode() : 0) + (this.networkResourceModelUuid != null ? this.networkResourceModelUuid.hashCode() : 0);
143         return result;
144     }
145
146 }