I have a Map the String key is nothing but numeric value like \"123\" etc. I\'m getting numeric value because this values are
Map
String
You can now use Java 8 stream, map, collect to do this in a more readable, clean manner.
Map oldMap Map newMap = oldMap.entrySet().stream() .collect(Collectors.toMap(entry -> Long.parseLong(entry.getKey()), Map.Entry::getValue));