Class Note


  • public class Note
    extends Object
    A map note. It always has at least one comment since a comment is required to create a note on osm.org.
    Since:
    7451
    • Constructor Detail

      • Note

        public Note​(LatLon latLon)
        Create a note with a given location
        Parameters:
        latLon - Geographic location of this note
    • Method Detail

      • getId

        public long getId()
        Returns the unique OSM ID of this note.
        Returns:
        The unique OSM ID of this note
      • setId

        public void setId​(long id)
        Sets note id.
        Parameters:
        id - OSM ID of this note
      • getLatLon

        public LatLon getLatLon()
        Returns the geographic location of the note.
        Returns:
        The geographic location of the note
      • getCreatedAt

        public Instant getCreatedAt()
        Returns the date at which this note was submitted.
        Returns:
        Date that this note was submitted
      • setCreatedAt

        public void setCreatedAt​(Instant createdAt)
        Sets date at which this note has been created.
        Parameters:
        createdAt - date at which this note has been created
      • getClosedAt

        public Instant getClosedAt()
        Returns the date at which this note was closed.
        Returns:
        Date that this note was closed. Null if it is still open.
      • setClosedAt

        public void setClosedAt​(Instant closedAt)
        Sets date at which this note has been closed.
        Parameters:
        closedAt - date at which this note has been closed
      • getState

        public Note.State getState()
        Returns the open or closed state of this note.
        Returns:
        The open or closed state of this note
      • setState

        public void setState​(Note.State state)
        Sets the note state.
        Parameters:
        state - note state (open or closed)
      • getComments

        public List<NoteCommentgetComments()
        Returns the list of comments associated with this note.
        Returns:
        An ordered list of comments associated with this note
      • getLastComment

        @Nullable
        public NoteComment getLastComment()
        Returns the last comment, or null.
        Returns:
        the last comment, or null
        Since:
        11821
      • addComment

        public void addComment​(NoteComment comment)
        Adds a comment.
        Parameters:
        comment - note comment
      • getFirstComment

        @Nullable
        public NoteComment getFirstComment()
        Returns the comment that was submitted by the user when creating the note
        Returns:
        First comment object
      • updateWith

        public void updateWith​(Note note)
        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