Skip to content
Advertisement

count non-null numbers of an object

I am making a method that can count non null value of an object, but I have an object inside another object and I have to confirm if that object is empty too, I tried with isEmpty, isNull but it says it is not empty.

Object

JavaScript

Validation method

JavaScript

I have also tried with !ObjectUtils.isNull...

Even though the “result” object has no values it says that it is not empty`

Setter

JavaScript

Here it should not show me “result” as different from null, because so far there is the instance of the class “ResultExceptionDTO” with its null attributes

Advertisement

Answer

Here is the method that works:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement