Interface SectionMap

    • Method Detail

      • set

        default void set​(String key,
                         Object value)
        Store the key-value pair
        Parameters:
        key - the key of the key-value pair
        value - 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 value type
        Parameters:
        key - the key of the key-value pair
        Returns:
        the value
        Throws:
        ClassCastException - if the value is not the specified 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 Note: if the section named key already exists, it will be replaced by a new section
        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
      • keys

        default Set<String> keys()
        Get all the keys in set
        Returns:
        all the keys in set
      • getSection

        SectionMap getSection​(String key)
        Get the section named key Note: if the section named key does not exist, it will be created
        Parameters:
        key - the key of the Section
        Returns:
        the section named key
        Throws:
        UnsupportedOperationException - if there is no section named key
      • containsSection

        boolean containsSection​(String key)
        Indicate there is a section named key
        Parameters:
        key - the key of the Section
        Returns:
        true there is a section named key, false otherwise
      • getOrDefault

        default <T> T getOrDefault​(String key,
                                   T defaultValue)
        Get the value of the key-value pair
        Type Parameters:
        T - the value type
        Parameters:
        key - the key of the key-value pair
        defaultValue - the default value
        Returns:
        the value or defaultValue if there is no value
      • compute

        default void compute​(String key,
                             java.util.function.BiFunction<? super String,​? super Object,​?> remappingFunction)
        compute the value of the key-value pair
        Parameters:
        key - the key of the key-value pair
        remappingFunction - the remapping function