Change the header to SO
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / ServiceToNetworks.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.io.Serializable;
23 import java.sql.Timestamp;
24
25 public class ServiceToNetworks implements Serializable {
26
27         // This maps to SERVICE.SERVICE_NAME_VERSION_ID / Service.serviceNameVersionId in SERVICE/Service table
28         private String serviceModelUuid;
29         // This maps to NETWORK_RESOURCE_CUSTOMIZATION.MODEL_CUSTOMIZATION_UUID / NetworkResourceCustomization.ModelCustomizationUuid
30         private String networkModelCustomizationUuid;
31         private Timestamp created;
32         public static final long serialVersionUID = -1322322139926390329L;
33
34         public ServiceToNetworks() {
35                 super();
36         }
37
38         public String getServiceModelUuid() {
39                 return this.serviceModelUuid;
40         }
41         public void setServiceModelUuid(String serviceModelUuid) {
42                 this.serviceModelUuid = serviceModelUuid;
43         }
44
45         public String getNetworkModelCustomizationUuid() {
46                 return this.networkModelCustomizationUuid;
47         }
48         public void setNetworkModelCustomizationUuid(String networkCustomizationUuid) {
49                 this.networkModelCustomizationUuid = networkCustomizationUuid;
50         }
51
52         public Timestamp getCreated() {
53                 return this.created;
54         }
55         public void setCreated(Timestamp timestamp) {
56                 this.created = timestamp;
57         }
58
59         @Override
60         public boolean equals(Object o) {
61         if (!(o instanceof ServiceToNetworks)) {
62             return false;
63         }
64         if (this == o) {
65             return true;
66         }
67         ServiceToNetworks stn = (ServiceToNetworks) o;
68         if (stn.getNetworkModelCustomizationUuid().equals(this.getNetworkModelCustomizationUuid())
69                         && stn.getServiceModelUuid().equals(this.getServiceModelUuid())) {
70             return true;
71         } 
72         return false;
73         }
74         
75         @Override 
76         public int hashCode() {
77                 
78                 int code = this.networkModelCustomizationUuid == null ? 0 : this.networkModelCustomizationUuid.hashCode();
79                 code += this.serviceModelUuid == null ? 0 : this.serviceModelUuid.hashCode();
80                 
81                 return code;
82         }
83         
84         @Override
85         public String toString() {
86                 StringBuilder sb = new StringBuilder();
87                 sb.append("ServiceToNetworks mapping: ");
88                 sb.append("serviceModelUuid=" + this.serviceModelUuid);
89                 sb.append(",networkModelCustomizationUuid=" + networkModelCustomizationUuid);
90                 return sb.toString();
91         }
92
93 }