public class Note extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Note.State
Note state
|
Modifier and Type | Field and Description |
---|---|
private java.util.Date |
closedAt |
private java.util.List<NoteComment> |
comments |
private java.util.Date |
createdAt |
static java.util.Comparator<Note> |
DATE_COMPARATOR
Sorts notes strictly by creation date
|
static java.util.Comparator<Note> |
DEFAULT_COMPARATOR
Sorts notes in the following order:
1) Open notes
2) Closed notes
3) New notes
Within each subgroup it sorts by ID
|
private long |
id |
static java.util.Comparator<Note> |
LAST_ACTION_COMPARATOR
Sorts notes by the last modified date
|
private LatLon |
latLon |
private Note.State |
state |
static java.util.Comparator<Note> |
USER_COMPARATOR
Sorts notes by user, then creation date
|
Constructor and Description |
---|
Note(LatLon latLon)
Create a note with a given location
|
Modifier and Type | Method and Description |
---|---|
void |
addComment(NoteComment comment)
Adds a comment.
|
boolean |
equals(java.lang.Object obj) |
java.util.Date |
getClosedAt()
Returns the date at which this note was closed.
|
java.util.List<NoteComment> |
getComments()
Returns the list of comments associated with this note.
|
java.util.Date |
getCreatedAt()
Returns the date at which this note was submitted.
|
NoteComment |
getFirstComment()
Returns the comment that was submitted by the user when creating the note
|
long |
getId()
Returns the unique OSM ID of this note.
|
NoteComment |
getLastComment()
Returns the last comment, or
null . |
LatLon |
getLatLon()
Returns the geographic location of the note.
|
Note.State |
getState()
Returns the open or closed state of this note.
|
int |
hashCode() |
void |
setClosedAt(java.util.Date closedAt)
Sets date at which this note has been closed.
|
void |
setCreatedAt(java.util.Date createdAt)
Sets date at which this note has been created.
|
void |
setId(long id)
Sets note id.
|
void |
setState(Note.State state)
Sets the note state.
|
java.lang.String |
toString() |
void |
updateWith(Note note)
Copies values from a new note into an existing one.
|
public static final java.util.Comparator<Note> DEFAULT_COMPARATOR
public static final java.util.Comparator<Note> DATE_COMPARATOR
public static final java.util.Comparator<Note> USER_COMPARATOR
public static final java.util.Comparator<Note> LAST_ACTION_COMPARATOR
private long id
private java.util.Date createdAt
private java.util.Date closedAt
private Note.State state
private java.util.List<NoteComment> comments
public long getId()
public void setId(long id)
id
- OSM ID of this notepublic LatLon getLatLon()
public java.util.Date getCreatedAt()
public void setCreatedAt(java.util.Date createdAt)
createdAt
- date at which this note has been createdpublic java.util.Date getClosedAt()
public void setClosedAt(java.util.Date closedAt)
closedAt
- date at which this note has been closedpublic Note.State getState()
public void setState(Note.State state)
state
- note state (open or closed)public java.util.List<NoteComment> getComments()
public NoteComment getLastComment()
null
.null
public void addComment(NoteComment comment)
comment
- note commentpublic NoteComment getFirstComment()
public void updateWith(Note note)
note
- New values to copypublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object