Timeline for What is the best way to know if all the variables in a Class are null?
Current License: CC BY-SA 3.0
2 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 9, 2023 at 8:13 | comment | added | Holger |
Instead of comparing field[j].getGenericType().toString() with "class java.lang.String" , you can use a straight-forward check of the actual type, i.e. if(field[j].getType() == String.class) That’s simpler and way more efficient.
|
|
Sep 11, 2012 at 3:20 | history | answered | rookiepupil | CC BY-SA 3.0 |