public static List<Map<String, Object>> toListMap(String json){
List<Object> list =JSON.parseArray(json); List< Map<String,Object>> listw = new ArrayList<Map<String,Object>>();
for (Object object : list){
Map<String,Object> ageMap = new HashMap<String,Object>();
Map <String,Object> ret = (Map<String, Object>) object;//取出list里面的值转为map
/*for (Entry<String, Object> entry : ret.entrySet()) {
ageMap.put(entry.getKey());
System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
listw.add(ageMap); //添加到list集合 成为 list<map<String,Object>> 集合
} */
listw.add(ret);
}
return listw; }

  

String 转 List<Map<String, Object>>的更多相关文章

  1. 用java String类的getBytes(String charsetName)和String(byte[] bytes, String charsetName)解决乱码问题

    Java中String的数据是如何存储的,查看源代码就可以知道,String的数据是存储在char[] value这样一个成员变量中的,char类型的大小在java中是2个字节 我们还知道,现在普遍使 ...

  2. string.IsNullOrEmpty和string.IsNullOrWhiteSpace方法的区别

    string.IsNullOrEmpty 都知道,这个功能是判断字符串是否为:null或者string.Empty.如果是如"\t"这样的字符就返回false了,为了达到判断过滤这 ...

  3. 关于String str =new String("abc")和 String str = "abc"的比较

    String是一个非常常用的类,应该深入的去了解String 如: String str =new String("abc") String str1 = "abc&qu ...

  4. Javascript中String()与new String()的差异

    这里主要关注的是值类型和引用类型. 我们知道在javascript中的变量在内存中的存储有两种形式,值类型存储和引用类型存储. 通常可以进行值存储的包括  字符串类型,布尔值类型,数字类型,他们都包含 ...

  5. C#、.Net代码精简优化(空操作符(??)、as、string.IsNullOrEmpty() 、 string.IsNullOrWhiteSpace()、string.Equals()、System.IO.Path 的用法)

    一.空操作符(??)在程序中经常会遇到对字符串或是对象判断null的操作,如果为null则给空值或是一个指定的值.通常我们会这样来处理: .string name = value; if (name ...

  6. 经典String str = new String("abc")内存分配问题

    出自:http://blog.csdn.net/ycwload/article/details/2650059 今天要找和存储管理相关的一些知识,网上搜了半天也没有找到完善的(30%的程度都不到),没 ...

  7. 字符串中判断存在的几种模式和效率(string.contains、string.IndexOf、Regex.Match)

    通常情况下,我们判断一个字符串中是否存在某值常常会用string.contains,其实判断一个字符串中存在某值的方法有很多种,最常用的就是前述所说的string.contains,相对来说比较常用的 ...

  8. C# string.format、string.connect和+=运算 效率计算

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Stri ...

  9. 如何将List<string>转化为string

    Convert List, string. A List can be converted to a string. This is possible with the ToArray method ...

  10. 1,字符是否为空,2,比较两个字符大小。String.Compare(String, String)。string.IsNullOrEmpty(string)

    1, String.Compare 方法 (String, String) 比较两个指定的 String 对象. 值 条件 小于零 strA 小于 strB. 零 strA 等于 strB. 大于零 ...

随机推荐

  1. Linux常用指令总结

    概述 因为平时不是经常使用Linux系统,每次用到都需要重新温习一遍,这里对自己平时经常使用到的指令做个小结,方便后面直接查阅. 常用指令 登陆root指令 sudo su - 安装软件及卸载指令 d ...

  2. LAMP架构三

    PHP相关配置 1.查找php配置文件/usr/local/php/bin/php -i或者phpinfo() [root@bogon admin]# /usr/local/php/bin/php - ...

  3. hdu2647(拓扑排序)

    链接:点击打开链接 题意:每一个人的基本工资为888,给出两个人的关系a,b,代表a的工资比b高问满足全部条件的话,最少须要支付多少钱 代码: #include <map> #includ ...

  4. C语言 Linux环境变量

    /* *@author cody *@date 2014-08-12 *@description */ /* extern char **environ //environment values #i ...

  5. POJ2185-Milking Grid(KMP,next数组的应用)

    Milking Grid Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 6317   Accepted: 2648 Desc ...

  6. 打败 IE 的葵花宝典:CSS Bug Table

    博主说:本博客文章来源包括转载,翻译,原创,且在文章内均有标明.鼓励原创,支持创作共享,请勿用于商业用途,转载请注明文章链接.本文链接:http://www.kein.pw/?p=35 原文发表于:A ...

  7. Verilog语言:还真的是人格分裂的语言

    人气腹语术师天愿在现场披露了被人偶搭档夺取灵魂的腹语术师将妻子杀害的表演节目.天愿真的陷入了多重人格,命令自己杀害妻子和子的人偶的人格出现了.为了不(让自己)杀害和弟子登川有外遇的妻子,天愿提出委托想 ...

  8. C# 执行多条SQL更新语句,实现数据库事务

    class Program { class Result<T> { public T data; public string Message; public bool Success; p ...

  9. pair + map 函数结合使用

    题目链接:codeforces 44A5birch yellowmaple redbirch yellowmaple yellowmaple green 4 3oak yellowoak yellow ...

  10. Makefile 多个目标匹配的问题

    在windows下直接使用mingw32-make # ZTHREAD_A the static link library file of ZThread ZTHREAD_A = F:/ZJ/tool ...