Replace collections size with isEmpty 35/93235/1
authorsindhu3672 <arcot.sindhuri@huawei.com>
Fri, 9 Aug 2019 17:09:55 +0000 (22:39 +0530)
committersindhu3672 <arcot.sindhuri@huawei.com>
Fri, 9 Aug 2019 17:09:55 +0000 (22:39 +0530)
Replace collections size with isEmpty mso-adapter-utils class

Issue-ID: SO-2187

Signed-off-by: sindhu3672 <arcot.sindhuri@huawei.com>
Change-Id: Icf6fc86d9d6f02571938804d214b5b5bfca72698

adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java

index 8cacf85..468b771 100644 (file)
@@ -132,14 +132,14 @@ public class MsoHeatEnvironmentEntry {
     }
 
     public boolean hasResources() {
-        if (this.resources != null && this.resources.size() > 0) {
+        if (this.resources != null && !this.resources.isEmpty()) {
             return true;
         }
         return false;
     }
 
     public boolean hasParameters() {
-        if (this.parameters != null && this.parameters.size() > 0) {
+        if (this.parameters != null && !this.parameters.isEmpty()) {
             return true;
         }
         return false;
@@ -147,7 +147,7 @@ public class MsoHeatEnvironmentEntry {
 
     public boolean containsParameter(String paramName) {
         boolean contains = false;
-        if (this.parameters == null || this.parameters.size() < 1) {
+        if (this.parameters == null || this.parameters.isEmpty()) {
             return false;
         }
         if (this.parameters.contains(new MsoHeatEnvironmentParameter(paramName))) {