I am getting a String array back from a service (or actually a comma separated String which I'm splitting into a String array), and I want to extract those into separate Strings with meaningful names, e.g.:
String value = contents[0];
String name = contents[1];
String date = contents[2];
String status = contents[3];
...
Since the array is long and there are many such Strings to extract, I'm looking for the shortest way to do this, but couldn't find anything on SO/ the web. Thanks!
Edit
As an example, the input could be something like ["foo","bar","2017/04/01","A"], I want to extract those to meaningfully named Strings as described above, and then use those along the way, e.g. call function1(name, date) and then function2(name, value) etc. - I only want this translation (which needs to know which array index holds what data) to happen once and spare my code the need to know this mapping of array index to meaning everywhere. So I could have a translate function that does that and inserts the values into a map or something, but I thought that since these are all Strings there should be a way for me to initialize all of them at once.