2 Minutes To Code (β Version)

JSON and gson api - 2 minute tutorial

CollectionsBag.java - Source code of artefact used in this tutorial

Given below is the source code of class com.techfundaes.gsonBag.CollectionsBag which is used in earlier examples.
package com.techfundaes.gsonBag;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.TreeMap;

public class CollectionsBag
	int[] years;
	ArrayList<String> userList  = new ArrayList<String>();
	Hashtable<String, String> deptMap = new Hashtable<String, String>();
	TreeMap<String, String> gameAuthorMap = null;
	public CollectionsBag()
		years = new int[] {2012, 2013}; 
		deptMap.put("logistics", "Amsterdam");
		deptMap.put("sales", "Auckland");

	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("CollectionsBag [years=").append(Arrays.toString(years))
				.append(", userList=").append(userList).append(", deptMap=")
				.append(deptMap).append(", gameAuthorMap=")
		return builder.toString();