diff options
Diffstat (limited to 'ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java')
-rw-r--r-- | ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java index 6b368d331..1dca60cbc 100644 --- a/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java +++ b/ECOMP-REST/src/main/java/org/openecomp/policy/rest/adapter/ServiceGroupJson.java @@ -39,15 +39,19 @@ public class ServiceGroupJson { this.name = value; } - public boolean equals(Object obj) - { + public boolean equals(Object obj){ + if(obj == null){ + return false; + } + if(this.getClass() != obj.getClass()){ + return false; + } ServiceGroupJson servGroupobj=(ServiceGroupJson) obj; - if(this.getName().equals(servGroupobj.getName())) - { - return true; - } - return false; - } + if(this.getName().equals(servGroupobj.getName())){ + return true; + } + return false; + } public int hashCode() { return Integer.valueOf(name.charAt(0)+(name.charAt(1))); |