Package top.focess.qq.api.util
Interface SectionMap
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
JSON,JSONSection,Session,SessionSection,YamlConfiguration,YamlConfigurationSection
public interface SectionMap extends Serializable
This is an util class to define basic access to the data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleancontains(String key)Indicate there is a key-value pair named keySectionMapcreateSection(String key)Create the section named keydefault <T> Tget(String key)Get the value of the key-value pairSectionMapgetSection(String key)Get the section named keyMap<String,Object>getValues()Get all the key-value pairsdefault Set<String>keys()Get all the keys in setdefault voidremove(String key)Remove the key-value pair named keydefault voidset(String key, Object value)Store the key-value pair
-
-
-
Method Detail
-
set
default void set(String key, Object value)
Store the key-value pair- Parameters:
key- the key of the key-value pairvalue- the value of the key-value pair
-
get
default <T> T get(String key)
Get the value of the key-value pair- Type Parameters:
T- the desired type- Parameters:
key- the key of the key-value pair- Returns:
- the desired value
- Throws:
ClassCastException- if the desired T type is not equal to its original type
-
contains
default boolean contains(String key)
Indicate there is a key-value pair named key- Parameters:
key- the key of the key-value pair- Returns:
- true there is a key-value pair named key, false otherwise
-
remove
default void remove(String key)
Remove the key-value pair named key- Parameters:
key- the key of the key-value pair
-
createSection
SectionMap createSection(String key)
Create the section named key- Parameters:
key- the key of the Section- Returns:
- a section named key
-
getValues
Map<String,Object> getValues()
Get all the key-value pairs- Returns:
- all the key-value pairs
-
getSection
SectionMap getSection(String key)
Get the section named key- Parameters:
key- the key of the Section- Returns:
- the section named key
- Throws:
UnsupportedOperationException- if there is no section named key
-
-