Interface Commentable


public interface Commentable
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Retrieve the block comment of the section or value selected by path.
    Retrieve the comment of the section or value selected by path.
    default void
    setComment(String path, String comment)
    Set a block comment above the section or value selected by path.
    void
    setComment(String path, String comment, CommentType type)
    Set a comment to the section or value selected by path.
  • Method Details

    • setComment

      void setComment(String path, String comment, CommentType type)
      Set a comment to the section or value selected by path. Comment will be indented automatically. Multi-line comments can be provided using \n character.
      Parameters:
      path - path of desired section or key
      comment - the comment to add, # symbol is not needed
      type - either above (BLOCK) or SIDE
    • setComment

      default void setComment(String path, String comment)
      Set a block comment above the section or value selected by path. Comment will be indented automatically. Multi-line comments can be provided using \n character.
      Parameters:
      path - path of desired section or key
      comment - the comment to add, # symbol is not needed
    • getComment

      String getComment(String path, CommentType type)
      Retrieve the comment of the section or value selected by path.
      Parameters:
      path - path of desired section or key
      type - either above (BLOCK) or SIDE
      Returns:
      the comment of the section or value selected by path, or null if that path does not have any comment of this type
    • getComment

      default String getComment(String path)
      Retrieve the block comment of the section or value selected by path.
      Parameters:
      path - path of desired section or key
      Returns:
      the block comment of the section or value selected by path, or null if that path does not have any comment of type block