diff options
author | 2018-03-28 10:12:15 -0400 | |
---|---|---|
committer | 2018-03-28 12:08:08 -0400 | |
commit | 1f8f50733aaaa103cdb7e34099179cba436f754c (patch) | |
tree | e4c771841728c279b90cc1b0213f79c4c26bcb4b /mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java | |
parent | 4e651eb259dac4188e1568ac65e69d68a91e6296 (diff) |
improved coverage for catalog db beans
Change-Id: Ibf1fd21dc81f0a3e16447b05dfce1761efa69237
Issue-ID: SO-541
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java')
-rw-r--r-- | mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java index df067445f6..1fff17612e 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/beans/HeatNestedTemplate.java @@ -23,11 +23,15 @@ package org.openecomp.mso.db.catalog.beans; import java.io.Serializable; +import com.openpojo.business.annotation.BusinessKey; + public class HeatNestedTemplate implements Serializable { - private String parentTemplateId; - private String childTemplateId; - private String providerResourceFile; + @BusinessKey + private String parentTemplateId = null; + @BusinessKey + private String childTemplateId = null; + private String providerResourceFile = null; public static final long serialVersionUID = -1322322139926390329L; public HeatNestedTemplate () { @@ -91,7 +95,15 @@ public class HeatNestedTemplate implements Serializable { // hash code does not have to be a unique result - only that two objects that should be treated as equal // return the same value. so this should work. int result; - result = this.parentTemplateId.hashCode() + this.childTemplateId.hashCode(); + int parentTemplateIdHash = 0; + int childTemplateIdHash = 0; + if (this.parentTemplateId != null) { + parentTemplateIdHash = this.parentTemplateId.hashCode(); + } + if (this.childTemplateId != null) { + childTemplateIdHash = this.childTemplateId.hashCode(); + } + result = parentTemplateIdHash + childTemplateIdHash; return result; } } |