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