Class NoteComment
java.lang.Object
org.openstreetmap.josm.data.notes.NoteComment
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 ClassesModifier and TypeClassDescriptionstatic enumEvery comment has an associated action. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NoteComment.Actionprivate final Instantstatic final Comparator<NoteComment>Sorts note comments strictly by creation dateprivate booleanprivate final Stringprivate final User -
Constructor Summary
ConstructorsConstructorDescriptionNoteComment(Instant createDate, User user, String commentText, NoteComment.Action action, boolean isNew) -
Method Summary
Modifier and TypeMethodDescriptionReturns the time at which this comment was created.Returns the action associated with this note.getText()Returns Plain text of user's comment.getUser()Returns the user who made this comment.booleanisNew()Determines if this is a new comment/action and needs to be uploaded to the APIvoidsetNew(boolean isNew) Sets whether this is a new comment/action and needs to be uploaded to the APItoString()
-
Field Details
-
text
-
user
-
commentTimestamp
-
action
-
isNew
-
DATE_COMPARATOR
Sorts note comments strictly by creation date
-
-
Constructor Details
-
NoteComment
public NoteComment(Instant createDate, User user, String commentText, NoteComment.Action action, boolean isNew) - Parameters:
createDate- The time at which this comment was addeduser- JOSM User object of the user who created the commentcommentText- The text left by the user. Is sometimes blankaction- The action associated with this commentisNew- Whether or not this comment is new and needs to be uploaded
-
-
Method Details
-
getText
Returns Plain text of user's comment.- Returns:
- Plain text of user's comment
-
getUser
Returns the user who made this comment.- Returns:
- JOSM's User object for the user who made this comment
-
getCommentTimestamp
Returns the time at which this comment was created.- Returns:
- The time at which this comment was created
-
getNoteAction
Returns the action associated with this note.- Returns:
- the action associated with this note
-
setNew
Sets whether this is a new comment/action and needs to be uploaded to the API- Parameters:
isNew-trueif this is a new comment/action and needs to be uploaded to the API
-
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
-