Class NoteComment


  • public class NoteComment
    extends java.lang.Object
    Represents a comment made on a note. All notes have at least on comment which is the comment the note was opened with. Comments are immutable.
    Since:
    7451
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  NoteComment.Action
      Every comment has an associated action.
    • Constructor Summary

      Constructors 
      Constructor Description
      NoteComment​(java.time.Instant createDate, User user, java.lang.String commentText, NoteComment.Action action, boolean isNew)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.time.Instant getCommentTimestamp()
      Returns the time at which this comment was created.
      NoteComment.Action getNoteAction()
      Returns the action associated with this note.
      java.lang.String getText()
      Returns Plain text of user's comment.
      User getUser()
      Returns the user who made this comment.
      boolean isNew()
      Determines if this is a new comment/action and needs to be uploaded to the API
      void setNew​(boolean isNew)
      Sets whether this is a new comment/action and needs to be uploaded to the API
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NoteComment

        public NoteComment​(java.time.Instant createDate,
                           User user,
                           java.lang.String commentText,
                           NoteComment.Action action,
                           boolean isNew)
        Parameters:
        createDate - The time at which this comment was added
        user - JOSM User object of the user who created the comment
        commentText - The text left by the user. Is sometimes blank
        action - The action associated with this comment
        isNew - Whether or not this comment is new and needs to be uploaded
    • Method Detail

      • getText

        public java.lang.String getText()
        Returns Plain text of user's comment.
        Returns:
        Plain text of user's comment
      • getUser

        public User getUser()
        Returns the user who made this comment.
        Returns:
        JOSM's User object for the user who made this comment
      • getCommentTimestamp

        public java.time.Instant getCommentTimestamp()
        Returns the time at which this comment was created.
        Returns:
        The time at which this comment was created
      • setNew

        public void setNew​(boolean isNew)
        Sets whether this is a new comment/action and needs to be uploaded to the API
        Parameters:
        isNew - true if this is a new comment/action and needs to be uploaded to the API
      • isNew

        public boolean isNew()
        Determines if this is a new comment/action and needs to be uploaded to the API
        Returns:
        true if this is a new comment/action and needs to be uploaded to the API
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object