zoukankan      html  css  js  c++  java
  • 学习笔记:fastjson-1

     1     public int size() {
     2         return map.size();
     3     }
     4     public boolean isEmpty() {
     5         return map.isEmpty();
     6     }
     7     public boolean containsKey(Object key) {
     8         return map.containsKey(key);
     9     }
    10     public boolean containsValue(Object value) {
    11         return map.containsValue(value);
    12     }
    13     public Object get(Object key) {
    14         return map.get(key);
    15     }
    16     public JSONObject getJSONObject(String key) {
    17         Object value = map.get(key);
    18         if (value instanceof JSONObject) {
    19             return (JSONObject) value;
    20         }
    21         if (value instanceof String) {
    22             return JSON.parseObject((String) value);
    23         }
    24         return (JSONObject) toJSON(value);
    25     }
    26     public JSONArray getJSONArray(String key) {
    27         Object value = map.get(key);
    28         if (value instanceof JSONArray) {
    29             return (JSONArray) value;
    30         }
    31         if (value instanceof String) {
    32             return (JSONArray) JSON.parse((String) value);
    33         }
    34         return (JSONArray) toJSON(value);
    35     }

    常用的fastjson函数。

  • 相关阅读:
    信息收集-DNS
    Xshell下载
    JSP
    本地网络配置
    P1485 火枪打怪
    P4155 [SCOI2015]国旗计划
    P1017 [NOIP2000 提高组] 进制转换
    P1013 [NOIP1998 提高组] 进制位
    P1011 [NOIP1998 提高组] 车站
    CF841B Godsend
  • 原文地址:https://www.cnblogs.com/FightingMan/p/6227544.html
Copyright © 2011-2022 走看看