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