Merge "Reorder modifiers"
[so.git] / mso-catalog-db / src / main / java / org / openecomp / mso / db / catalog / beans / HeatTemplateArtifactUuidModelUuid.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
21 package org.openecomp.mso.db.catalog.beans;
22
23 import java.io.Serializable;
24
25 import com.openpojo.business.annotation.BusinessKey;
26
27 // an embeddable class to represent the Composite key for NetworkResource in the 1707 db refactoring
28 public class HeatTemplateArtifactUuidModelUuid implements Serializable {
29         
30         @BusinessKey
31         private String heatTemplateArtifactUuid = null;
32         @BusinessKey
33         private String modelUuid = null;
34         public static final long serialVersionUID = -1322322139926390329L;
35
36         public HeatTemplateArtifactUuidModelUuid() {
37         }
38         
39         public String getHeatTemplateArtifactUuid() {
40                 return this.heatTemplateArtifactUuid;
41         }
42         public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) {
43                 this.heatTemplateArtifactUuid = heatTemplateArtifactUuid;
44         }
45         public String getModelUuid() {
46                 return this.modelUuid;
47         }
48         public void setModelUuid(String modelUuid) {
49                 this.modelUuid = modelUuid;
50         }
51
52         @Override
53         public String toString() {
54                 return "heatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid + " modelUuid=" + this.modelUuid;
55         }
56
57     @Override
58     public boolean equals (Object o) {
59         if (!(o instanceof HeatTemplateArtifactUuidModelUuid)) {
60             return false;
61         }
62         if (this == o) {
63             return true;
64         }
65         HeatTemplateArtifactUuidModelUuid htaumu = (HeatTemplateArtifactUuidModelUuid) o;
66         if (htaumu.getHeatTemplateArtifactUuid().equals(this.getHeatTemplateArtifactUuid()) 
67                         && htaumu.getModelUuid().equals(this.getModelUuid())) {
68             return true;
69         }
70         return false;
71     }
72
73     @Override
74     public int hashCode () {
75         // hash code does not have to be a unique result - only that two objects that should be treated as equal
76         // return the same value. so this should work.
77         return this.heatTemplateArtifactUuid.hashCode() + this.modelUuid.hashCode();
78     }
79
80 }