Package top.focess.qq.api.util.json
Class JSON
- java.lang.Object
-
- top.focess.qq.api.util.json.JSON
-
- All Implemented Interfaces:
Serializable,SectionMap
- Direct Known Subclasses:
JSONSection
public class JSON extends Object implements SectionMap
This class is used to define a JSON object as Map.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JSONSectioncreateSection(String key)Create the section named keyJSONListgetList(String key)Get the list named keyJSONSectiongetSection(String key)Get the section named keyMap<String,Object>getValues()Get all the key-value pairsStringtoJson()Translate this JSON instance into json StringStringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface top.focess.qq.api.util.SectionMap
compute, contains, get, getOrDefault, keys, remove, set
-
-
-
-
Method Detail
-
createSection
public JSONSection createSection(String key)
Description copied from interface:SectionMapCreate the section named key- Specified by:
createSectionin interfaceSectionMap- Parameters:
key- the key of the Section- Returns:
- a section named key
-
getValues
public Map<String,Object> getValues()
Description copied from interface:SectionMapGet all the key-value pairs- Specified by:
getValuesin interfaceSectionMap- Returns:
- all the key-value pairs
-
getSection
public JSONSection getSection(String key)
Description copied from interface:SectionMapGet the section named key- Specified by:
getSectionin interfaceSectionMap- Parameters:
key- the key of the Section- Returns:
- the section named key
-
getList
public JSONList getList(String key)
Get the list named key- Parameters:
key- the key of the list- Returns:
- a list named key
-
toJson
public String toJson()
Translate this JSON instance into json String- Returns:
- json String translated from this JSON instance
-
-