Class Note


  • public class Note
    extends java.lang.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
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Note.State
      Note state
    • Constructor Summary

      Constructors 
      Constructor Description
      Note​(LatLon latLon)
      Create a note with a given location
    • 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 java.time.Instant getCreatedAt()
        Returns the date at which this note was submitted.
        Returns:
        Date that this note was submitted
      • setCreatedAt

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

        public java.time.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​(java.time.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 java.util.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
      • getUserName

        @Nullable
        private java.lang.String getUserName()
      • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

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