source: josm/trunk/src/org/openstreetmap/josm/data/notes/NoteComment.java@ 7599

Last change on this file since 7599 was 7451, checked in by bastiK, 10 years ago

applied #10434 - Initial classes to hold Notes data (patch by ToeBee)

  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.notes;
3
4import java.util.Date;
5
6import org.openstreetmap.josm.data.osm.User;
7
8/**
9 * Represents a comment made on a note. All notes have at least on comment
10 * which is the comment the note was opened with. Comments are immutable.
11 */
12public class NoteComment {
13
14 private String text;
15 private User user;
16 private Date commentTimestamp;
17 private Action action;
18
19 //not currently used. I'm planning on using this to keep track of new actions that need to be uploaded
20 private Boolean isNew;
21
22 /**
23 * Every comment has an associated action. Some comments are just comments
24 * while others indicate the note being opened, closed or reopened
25 */
26 public enum Action {opened, closed, reopened, commented}
27
28 /**
29 * @param createDate The time at which this comment was added
30 * @param user JOSM User object of the user who created the comment
31 * @param commentText The text left by the user. Is sometimes blank
32 * @param action The action associated with this comment
33 * @param isNew Whether or not this comment is new and needs to be uploaded
34 */
35 public NoteComment(Date createDate, User user, String commentText, Action action, Boolean isNew) {
36 this.text = commentText;
37 this.user = user;
38 this.commentTimestamp = createDate;
39 this.action = action;
40 this.isNew = isNew;
41 }
42
43 /** @return Plain text of user's comment */
44 public String getText() {
45 return text;
46 }
47
48 /** @return JOSM's User object for the user who made this comment */
49 public User getUser() {
50 return user;
51 }
52
53 /** @return The time at which this comment was created */
54 public Date getCommentTimestamp() {
55 return commentTimestamp;
56 }
57
58 /** @return the action associated with this note */
59 public Action getNoteAction() {
60 return action;
61 }
62
63 public void setIsNew(Boolean isNew) {
64 this.isNew = isNew;
65 }
66
67 /** @return true if this is a new comment/action and needs to be uploaded to the API */
68 public Boolean getIsNew() {
69 return isNew;
70 }
71}
Note: See TracBrowser for help on using the repository browser.