Class JSONUtils
- 
                    
                    - All Implemented Interfaces:
 
 public class JSONUtils
- 
                
                    
                    - 
                                
                            
                                Constructor SummaryConstructors Constructor Description JSONUtils()
 - 
                                
                            
                                Method SummaryModifier and Type Method Description static HashMap<String, MessageExpansion>jsonToExpansionEx(String originJson)Converts a JSON string into a HashMap<String, MessageExpansion>object MessageExpansionstatic HashMap<String, String>expansionExToMap(Map<String, MessageExpansion> map)Converts Map<String, MessageExpansion>toHashMap<String, String>MessageExpansionstatic StringmapTsCombineJson(Map<String, String> map, long ts)Assembles the user-defined Map collection and timestamp into a JSON string static StringexMapToJson(HashMap<String, MessageExpansion> hashMap)Parses the HashMap<String, MessageExpansion>object into a JSON string.static List<Object>removeKeysInExpansionEx(List<String> arrayList, HashMap<String, MessageExpansion> hashMap)Deletes the specified keys static List<Object>removeKeysTSInExpansionEx(long time, List<String> arrayList, HashMap<String, MessageExpansion> hashMap)Deletes the specified keys with timestamp comparison static HashMap<String, String>expansionExJSONToMap(String jsonString)Converts a JSON string into a HashMap<String, String>static StringhashMapToJson(Map<String, String> map)Converts Map<String, String> mapinto a JSON string in the format: key1:{ v:value1 }static List<String>mergeJson(String expansionJsonSet, String expansionExisted)Merges two JSON strings with timestamps - 
                    
                    
                    - 
                                
                            
                                Method Detail- 
                                        jsonToExpansionExstatic HashMap<String, MessageExpansion> jsonToExpansionEx(String originJson) Converts a JSON string into a HashMap<String, MessageExpansion>object MessageExpansion- Parameters:
- originJson- The original JSON string
- Returns:
- HashMap<String, MessageExpansion>MessageExpansion
 
 - 
                                        expansionExToMapstatic HashMap<String, String> expansionExToMap(Map<String, MessageExpansion> map) Converts Map<String, MessageExpansion>toHashMap<String, String>MessageExpansion- Parameters:
- map-- Map<String, MessageExpansion>
- Returns:
- HashMap<String, String>
 
 - 
                                        mapTsCombineJsonstatic String mapTsCombineJson(Map<String, String> map, long ts) Assembles the user-defined Map collection and timestamp into a JSON string - Parameters:
- map- Map
- ts- Timestamp
- Returns:
- String 
 
 - 
                                        exMapToJsonstatic String exMapToJson(HashMap<String, MessageExpansion> hashMap) Parses the HashMap<String, MessageExpansion>object into a JSON string.- Parameters:
- hashMap-- HashMap<String, MessageExpansion>
- Returns:
- The JSON string 
 
 - 
                                        removeKeysInExpansionExstatic List<Object> removeKeysInExpansionEx(List<String> arrayList, HashMap<String, MessageExpansion> hashMap) Deletes the specified keys - Parameters:
- arrayList- The collection of keys to be deleted
- hashMap-- HashMap<String, MessageExpansion>
- Returns:
- Full and incremental data after deletion 
 
 - 
                                        removeKeysTSInExpansionExstatic List<Object> removeKeysTSInExpansionEx(long time, List<String> arrayList, HashMap<String, MessageExpansion> hashMap) Deletes the specified keys with timestamp comparison - Parameters:
- arrayList- The collection of keys to be deleted
- hashMap-- HashMap<String, MessageExpansion>
- Returns:
- Full and incremental data after deletion 
 
 - 
                                        expansionExJSONToMapstatic HashMap<String, String> expansionExJSONToMap(String jsonString) Converts a JSON string into a HashMap<String, String>- Parameters:
- jsonString- The JSON string
- Returns:
- HashMap<String, String>
 
 - 
                                        hashMapToJsonstatic String hashMapToJson(Map<String, String> map) Converts Map<String, String> mapinto a JSON string in the format: key1:{ v:value1 }- Parameters:
- map-- Map<String, String> map
- Returns:
- JSON string 
 
 - 
                                        mergeJsonstatic List<String> mergeJson(String expansionJsonSet, String expansionExisted) Merges two JSON strings with timestamps - Parameters:
- expansionJsonSet- String
- expansionExisted- String
- Returns:
- Merged full and incremental data 
 
 
- 
                                        
 
- 
                                
                            
                                
 
- 
                    
                    
                    
 
-