You need to sign in to do that
Don't have an account?

Object of a Object return null!!
Hi all,
I may be a stupit question to be asked but here is the senario:
1. I have a jsone string and I am parsing it with JSONParser as
wrapGoogleData inv = (wrapGoogleData)parser.readValueAs(wrapGoogleData.class);
lstwrap.put(inv.id,inv);
I am getting the parsed string in my class as:
public class wrapGoogleData{ public string summary{get;set;} public string id{get;set;} public string status{get;set;} public creator creator; public start start; public endd endd; public wrapGoogleData(string entnm,string ezid,string sta, creator c,start s,endd e){ system.debug('****##########***'); summary= entnm; id= ezid; status = sta; creator = c; system.debug('****start***'+s); system.debug('****startDate***'+s.datetimed); //start = new start(s.datetimed); start = s; endd = e; } public creator getcreatorob(){ return (creator) creator; } public start getstartob(){ return (start) start; } public string getstartobdate(){ return (string) start.datetimed; } public endd getendob(){ return (endd ) endd; } } public class creator{ public string email{get;set;} public string displayName{get;set;} public string self{get;set;} } public class start{ public string datetimed{get;set;} /* public start(string str){ datetimed = str; }*/ } public class endd{ public string datetimed{get;set;} }
2. What i am doing is I am itrating over the map of this wrapper class as:
for(wrapGoogleData wpl : lstwrap.values()){ string getGoogle=''; getGoogle = getGoogle + 'start : "' + wpl.getstartob().datetimed +'",';
This returns a null pointer at the last line: But when I write it as it return a object and not null pointer var: How to get the datetimed variable in this senario???
getGoogle = getGoogle + 'start : "' + wpl.getstartob() +'",';
Do this Way
Sorry but that did'nt worked!!