public static PageData getPageData(PageData chargeData) { Iterator iterator = chargeData.entrySet().iterator(); PageData page =new PageData(); while (iterator.hasNext()) { Map.Entry<String, Object> entry = (Map.Entry<String, Object>) iterator.next(); String str = toCamel(entry.getKey(), false); if (!str.equals("id")){ page.put(str,entry.getValue()); } } return page; } public static String toCamel(String varName,boolean isClass) { String str = varName.toLowerCase(); String[] names = str.split("_"); StringBuilder finalName = new StringBuilder(); int i = 0; if(!isClass) { if(names.length == 1) { return str; } i = 1; finalName.append(names[0]); } for(; i < names.length; i++) { String temp = names[i]; char ch = temp.charAt(0); ch = Character.toUpperCase(ch); temp = ch + temp.substring(1); finalName.append(temp); } return finalName.toString(); }