Collections
The following methods are provided for accessing maps and collections:
The Type,Type...
arguments allow you to specify the component types for maps and collections.
List
class arguments can be followed by zero or one arguments representing the entry types.
Map
class arguments can be followed by zero or two arguments representing the key and value types.
The arguments can be chained to produce any data structure consisting of maps, collections, or POJOs.
Examples are shown below:
getObject("..." , List.class )
List<?>
getObject("..." , LinkedList.class )
LinkedList<?>
getObject("..." , HashSet.class , Integer.class )
HashSet<Integer>
getObject("..." , Map.class )
Map<?,?>
getObject("..." , HashMap.class )
HashMap<?,?>
getObject("..." , LinkedHashMap.class , String.class , MyBean.class )
LinkedHashMap<String,MyBean>
getObject("..." , HashMap.class , Integer.class , ArrayList.class , MyBean[].class )
LinkedHashMap<Integer,ArrayList<MyBean[]>>
List<Address> addresses = c.getObject(
Oftentimes, it might be useful to parse into the {@link oaj.ObjectList} and {@link oaj.ObjectMap} classes that provide the various convenience methods for working with JSON-like data structures:
ObjectMap m = c.getObject(