Am using Bean class to get/set value for the attributes. In some cases am gettig Exception in thread "main" java.lang.NullPointerException
error due to the value is null. What will be the best practice to handle null pointer exception when we get/set values from/to bean class.
Is that ternary operator is good to use or any other suggestions?
Please find the below line of code where am getting null pointer exception.
doc.setCatalog_title(sourceAsMap.get("catalog_title").toString());