HashMap savedStuff = new HashMap(); savedStuff.put(\"symbol\", this.symbol); //this is a string savedStuff.put(\"index\", this.index); //this is an int
HashMap savedStuff = new HashMap();
Of course, you will still have to be careful to use the right type when extracting elements.