how do i access an array by its keys in java
In this case i want the structure to be like this,
options[{"value":"0","label":"zero"},{"value":"1","label":"one"},
{"value":"2","label":"two"}]
Here if i want to access options[1].value should give me 1 and options[2].label should give me two.
How can i achieve this with Map<string><string[]>?
Also Can i pass “options” array as one of the keys in my hash map
protected Map<String, String[]> getValueProperties(int view, Field field) {
Map<String, String> properties = new HashMap<String,String[]>();
properties.put("options", []);
return properties
}
Create a
classas followsNow create you
optionsarray as follows:Now, options[1].value will give you 1.