I hava a Java map like this:
Map<String, Object> data = new HashMap<String, Object>();
And I am performing following operation on it:
data.put("case_ids", new int[] { 31527 });
Where case_ids is one of the attribute of 3rd party API. However, that API throws incorrect API request error
and suggests me to use List object instead of an Array for:
data.put("case_ids", new int[] { 31527 });
Not an expert of List, any suggestions? Like data.put("case_ids", new List[] { 31527 });
?
EDITED: Extending my current question (to avoid repost or similar question). What if I have huge set of values for above put operation and want to create a list of known values. I do not feel that it is a correct way to mention the list of values separated by commas like 31527, 31528, 31529, 31530, 31531,..etc. I would rather store this somewhere and just call that as a input here - data.put("case_ids", new int[] { input });
. Also, is that possible to do without a file? Just want to avoid dependency on file.