2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.mso.db.catalog.beans;
24 import java.io.Serializable;
26 public class HeatNestedTemplate implements Serializable {
28 private int parentTemplateId;
29 private int childTemplateId;
30 private String providerResourceFile;
31 public static final long serialVersionUID = -1322322139926390329L;
33 public HeatNestedTemplate () {
37 public void setParentTemplateId (int parentTemplateId) {
38 this.parentTemplateId = parentTemplateId;
41 public int getParentTemplateId () {
42 return this.parentTemplateId;
45 public void setChildTemplateId (int childTemplateId) {
46 this.childTemplateId = childTemplateId;
49 public int getChildTemplateId () {
50 return this.childTemplateId;
53 public void setProviderResourceFile (String providerResourceFile) {
54 this.providerResourceFile = providerResourceFile;
57 public String getProviderResourceFile () {
58 return this.providerResourceFile;
62 public String toString () {
63 StringBuilder sb = new StringBuilder ();
64 sb.append ("ParentTemplateId=" + this.parentTemplateId);
65 sb.append (", ChildTemplateId=" + this.childTemplateId);
66 if (this.providerResourceFile == null) {
67 sb.append (", providerResourceFile=null");
69 sb.append (",providerResourceFile=" + this.providerResourceFile);
71 return sb.toString ();
75 public boolean equals (Object o) {
76 if (!(o instanceof HeatNestedTemplate)) {
82 HeatNestedTemplate hnt = (HeatNestedTemplate) o;
83 if (hnt.getChildTemplateId () == this.childTemplateId && hnt.getParentTemplateId () == this.parentTemplateId) {
90 public int hashCode () {
91 // hash code does not have to be a unique result - only that two objects that should be treated as equal
92 // return the same value. so this should work.
94 result = this.parentTemplateId + this.childTemplateId;