This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
That looks like you have a Map<Integer, String>, rather than a Map<Integer, Object>. If you want it to behave as you ask you probably need to either define a custom type that parsed your string data in to the object you want, or use the table per class hierarchy pattern and add property value fields for each type you support (plus a disciminator).