The question is not too specific.
I'm not a Java developer, but I suppose Java has similar functionality as other languages. So there may already be an existing parser that does this for you.
If not, you can write your own. You'd need to split up the text alongside the commas (this would probably return an array of strings), then read every segment (every element in the array) individually and parse the expected type. You have to know the expected type, the computer cannot guess what type it is you'd have there (reliably).