I noticed an issue with java.lang.Boolean class that it can not parse nulls. I know it has the parseBoolean
static method but as it's signature states it only accepts String
and not an Object
.
In other words, it has the following signature:
public static boolean parseBoolean(String s)
but not:
Boolean.parseBoolean(Object)
What is the best way to check a Boolean value without falling on NullPointerException?