Interface UnmodifiableCommentedConfig

    • Method Detail

      • getComment

        default java.lang.String getComment​(java.lang.String path)
        Gets a comment from the config.
        Parameters:
        path - the comment's path, each part separated by a dot. Example "a.b.c"
        Returns:
        the comment at the given path, or null if there is none.
      • getComment

        java.lang.String getComment​(java.util.List<java.lang.String> path)
        Gets a comment from the config.
        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.
      • getOptionalComment

        default java.util.Optional<java.lang.String> getOptionalComment​(java.lang.String path)
        Gets an optional comment from the config.
        Parameters:
        path - the comment's path, each part separated by a dot. Example "a.b.c"
        Returns:
        an Optional containing the comment at the given path, or Optional.empty() if there is no such comment.
      • getOptionalComment

        default java.util.Optional<java.lang.String> getOptionalComment​(java.util.List<java.lang.String> path)
        Gets an optional comment from the config.
        Parameters:
        path - the comment's path, each element of the list is a different part of the path.
        Returns:
        an Optional containing the comment at the given path, or Optional.empty() if there is no such comment.
      • containsComment

        default boolean containsComment​(java.lang.String path)
        Checks if the config contains a comment at some path.
        Parameters:
        path - the path to check, each part separated by a dot. Example "a.b.c"
        Returns:
        true if the path is associated with a comment, false if it's not.
      • containsComment

        boolean containsComment​(java.util.List<java.lang.String> path)
        Checks if the config contains a comment at some path.
        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

        java.util.Map<java.lang.String,​java.lang.String> commentMap()
        Returns a Map view of the config's comments. If the config is unmodifiable then the returned map is unmodifiable too.

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

        Returns:
        a Map view of the config's comments.
      • getComments

        default java.util.Map<java.lang.String,​UnmodifiableCommentedConfig.CommentNode> getComments()
        Returns a Map containing a deep copy of all the comments in the config.
        Returns:
        a Map containing the comments in the config.
      • getComments

        default void getComments​(java.util.Map<java.lang.String,​UnmodifiableCommentedConfig.CommentNode> destination)
        Puts all the config's comments to the specified map.
        Parameters:
        destination - the map where to put the comments.
      • fake

        static UnmodifiableCommentedConfig fake​(UnmodifiableConfig config)
        If the specified config is an instance of UnmodifiableCommentedConfig, returns it. Else, returns a "fake" UnmodifiableCommentedConfig instance with the same values (ie the valueMaps are equal) as the config. This fake UnmodifiableCommentedConfig doesn't actually store nor process comments, it just provides the methods of UnmodifiableCommentedConfig.
        Parameters:
        config - the config
        Returns:
        an UnmodifiableCommentedConfig instance backed by the specified config