Object JsonToolkit

  • All Implemented Interfaces:

    
    public class JsonToolkit
    
                        
    Author:

    Toutatis_Gc

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • parseJsonObject

         final static JSONObject parseJsonObject(File file)

        将json文件内容转换为json对象

      • parseJsonObject

         final static JSONObject parseJsonObject(Object obj)

        将任意对象转换为json对象

      • getValue

         final static <T extends Any> T getValue(JSONObject obj, String key, Class<T> type)

        此方法获取以分隔符(.) 分隔的键,向下迭代以获取值.

        This method gets the delimiter (.) Delimited keys, iterating down to get the value.

        example: 获取json对象"obj.key1.key2.key3"的值111 { key1:{ key2: { key3: 111 } } }

      • setMaxRecordNum

         final static Unit setMaxRecordNum(Integer num)

        Change the maximum record value of recordJSONMap

        Parameters:
        num - Allows the size of a map to be recorded