Class NoteComment
- java.lang.Object
-
- org.openstreetmap.josm.data.notes.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.
-
Field Summary
Fields Modifier and Type Field Description private NoteComment.Action
action
private java.time.Instant
commentTimestamp
static java.util.Comparator<NoteComment>
DATE_COMPARATOR
Sorts note comments strictly by creation dateprivate boolean
isNew
private java.lang.String
text
private User
user
-
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 APIvoid
setNew(boolean isNew)
Sets whether this is a new comment/action and needs to be uploaded to the APIjava.lang.String
toString()
-
-
-
Field Detail
-
text
private final java.lang.String text
-
commentTimestamp
private final java.time.Instant commentTimestamp
-
action
private final NoteComment.Action action
-
isNew
private boolean isNew
-
DATE_COMPARATOR
public static final java.util.Comparator<NoteComment> DATE_COMPARATOR
Sorts note comments strictly by creation date
-
-
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 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 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
-
getNoteAction
public NoteComment.Action getNoteAction()
Returns the action associated with this note.- Returns:
- the action associated with this note
-
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 classjava.lang.Object
-
-