Class Note
java.lang.Object
org.openstreetmap.josm.data.notes.Note
A map note. It always has at least one comment since a comment is required to create a note on osm.org.
- Since:
- 7451
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Instantprivate List<NoteComment>private Instantstatic final Comparator<Note>Sorts notes strictly by creation datestatic final Comparator<Note>Sorts notes in the following order: Open notes Closed notes New notes Within each subgroup it sorts by IDprivate longstatic final Comparator<Note>Sorts notes by the last modified dateprivate LatLonprivate Note.Statestatic final Comparator<Note>Sorts notes by user, then creation date -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComment(NoteComment comment) Adds a comment.booleanReturns the date at which this note was closed.Returns the list of comments associated with this note.Returns the date at which this note was submitted.Returns the comment that was submitted by the user when creating the notelonggetId()Returns the unique OSM ID of this note.Returns the last comment, ornull.Returns the geographic location of the note.getState()Returns the open or closed state of this note.private StringinthashCode()voidsetClosedAt(Instant closedAt) Sets date at which this note has been closed.voidsetCreatedAt(Instant createdAt) Sets date at which this note has been created.voidsetId(long id) Sets note id.voidsetState(Note.State state) Sets the note state.toString()voidupdateWith(Note note) Copies values from a new note into an existing one.
-
Field Details
-
DEFAULT_COMPARATOR
Sorts notes in the following order:- Open notes
- Closed notes
- New notes
-
DATE_COMPARATOR
Sorts notes strictly by creation date -
USER_COMPARATOR
Sorts notes by user, then creation date -
LAST_ACTION_COMPARATOR
Sorts notes by the last modified date -
id
-
latLon
-
createdAt
-
closedAt
-
state
-
comments
-
-
Constructor Details
-
Note
Create a note with a given location- Parameters:
latLon- Geographic location of this note
-
-
Method Details
-
getId
Returns the unique OSM ID of this note.- Returns:
- The unique OSM ID of this note
-
setId
Sets note id.- Parameters:
id- OSM ID of this note
-
getLatLon
Returns the geographic location of the note.- Returns:
- The geographic location of the note
-
getCreatedAt
Returns the date at which this note was submitted.- Returns:
- Date that this note was submitted
-
setCreatedAt
Sets date at which this note has been created.- Parameters:
createdAt- date at which this note has been created
-
getClosedAt
Returns the date at which this note was closed.- Returns:
- Date that this note was closed. Null if it is still open.
-
setClosedAt
Sets date at which this note has been closed.- Parameters:
closedAt- date at which this note has been closed
-
getState
Returns the open or closed state of this note.- Returns:
- The open or closed state of this note
-
setState
Sets the note state.- Parameters:
state- note state (open or closed)
-
getComments
Returns the list of comments associated with this note.- Returns:
- An ordered list of comments associated with this note
-
getLastComment
Returns the last comment, ornull.- Returns:
- the last comment, or
null - Since:
- 11821
-
addComment
Adds a comment.- Parameters:
comment- note comment
-
getFirstComment
Returns the comment that was submitted by the user when creating the note- Returns:
- First comment object
-
getUserName
-
updateWith
Copies values from a new note into an existing one. Used after a note has been updated on the server and the local copy needs refreshing.- Parameters:
note- New values to copy
-
hashCode
-
equals
-
toString
-