Please find my below code that am checking for null using ternary operator before am setting the value to my bean class attributes.
doc.setCatalog_description(sourceAsMap != null && sourceAsMap.get("catalog_description") != null ? sourceAsMap.get("catalog_description").toString() : null);
Is there anyother way to simplify this code like below., Am just exploring by using org.apache.commons.lang3.ObjectUtils;
methods. But am not sure that it is correct or not.
doc.setCatalog_description(ObjectUtils.identityToString(sourceAsMap.get("catalog_description")));