Class AbstractCommentedConfig

    • Constructor Detail

      • AbstractCommentedConfig

        public AbstractCommentedConfig​(boolean concurrent)
      • AbstractCommentedConfig

        public AbstractCommentedConfig​(java.util.function.Supplier<java.util.Map<java.lang.String,​java.lang.Object>> mapCreator)
      • AbstractCommentedConfig

        public AbstractCommentedConfig​(java.util.Map<java.lang.String,​java.lang.Object> valuesMap)
        Creates an AbstractCommentedConfig backed by the specified map
        Parameters:
        valuesMap - the map containing the config's values
      • AbstractCommentedConfig

        public AbstractCommentedConfig​(UnmodifiableConfig toCopy,
                                       boolean concurrent)
        Creates an AbstractCommentedConfig that is a copy of the specified config.
        Parameters:
        toCopy - the config to copy
      • AbstractCommentedConfig

        public AbstractCommentedConfig​(UnmodifiableConfig toCopy,
                                       java.util.function.Supplier<java.util.Map<java.lang.String,​java.lang.Object>> mapCreator)
      • AbstractCommentedConfig

        public AbstractCommentedConfig​(UnmodifiableCommentedConfig toCopy,
                                       boolean concurrent)
        Creates an AbstractCommentedConfig that is a copy of the specified config.
        Parameters:
        toCopy - the config to copy
      • AbstractCommentedConfig

        public AbstractCommentedConfig​(UnmodifiableCommentedConfig toCopy,
                                       java.util.function.Supplier<java.util.Map<java.lang.String,​java.lang.Object>> mapCreator)
    • Method Detail

      • getDefaultCommentMap

        protected static java.util.Map<java.lang.String,​java.lang.String> getDefaultCommentMap​(boolean concurrent)
      • getComment

        public java.lang.String getComment​(java.util.List<java.lang.String> path)
        Description copied from interface: UnmodifiableCommentedConfig
        Gets a comment from the config.
        Specified by:
        getComment in interface UnmodifiableCommentedConfig
        Parameters:
        path - the comment's path, each element of the list is a different part of the path.
        Returns:
        the comment at the given path, or null if there is none.
      • setComment

        public java.lang.String setComment​(java.util.List<java.lang.String> path,
                                           java.lang.String comment)
        Description copied from interface: CommentedConfig
        Sets a config comment.
        Specified by:
        setComment in interface CommentedConfig
        Parameters:
        path - the comment's path, each element of the list is a different part of the path.
        comment - the comment to set
        Returns:
        the old comment if any, or null
      • removeComment

        public java.lang.String removeComment​(java.util.List<java.lang.String> path)
        Description copied from interface: CommentedConfig
        Removes a comment from the config.
        Specified by:
        removeComment in interface CommentedConfig
        Parameters:
        path - the comment's path, each element of the list is a different part of the path.
        Returns:
        the old comment if any, or null
      • containsComment

        public boolean containsComment​(java.util.List<java.lang.String> path)
        Description copied from interface: UnmodifiableCommentedConfig
        Checks if the config contains a comment at some path.
        Specified by:
        containsComment in interface UnmodifiableCommentedConfig
        Parameters:
        path - the path to check, each element of the list is a different part of the path.
        Returns:
        true if the path is associated with a comment, false if it's not.
      • commentMap

        public java.util.Map<java.lang.String,​java.lang.String> commentMap()
        Description copied from interface: CommentedConfig
        Returns a Map view of the config's comments. Any change to the map is reflected in the config and vice-versa.

        The comment map contains only the comments of the direct elements of the configuration, not the comments of their sub-elements.

        Specified by:
        commentMap in interface CommentedConfig
        Specified by:
        commentMap in interface UnmodifiableCommentedConfig
        Returns:
        a Map view of the config's comments.
      • clone

        public abstract AbstractCommentedConfig clone()
        Description copied from class: AbstractConfig
        Creates and return a copy of this config.
        Specified by:
        clone in class AbstractConfig
        Returns:
        a new config that contains the same entries (including comments) as this config.
      • clear

        public void clear()
        Description copied from interface: Config
        Removes all values from the config.
        Specified by:
        clear in interface Config
        Overrides:
        clear in class AbstractConfig