1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.osm;
|
---|
3 |
|
---|
4 | import java.util.Date;
|
---|
5 |
|
---|
6 | import org.openstreetmap.josm.tools.date.DateUtils;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * A comment in a public changeset discussion.
|
---|
10 | * @since 7704
|
---|
11 | */
|
---|
12 | public class ChangesetDiscussionComment {
|
---|
13 |
|
---|
14 | /** date this comment was posted at */
|
---|
15 | private final Date date;
|
---|
16 | /** the user who posted the comment */
|
---|
17 | private final User user;
|
---|
18 | /** comment text */
|
---|
19 | private String text;
|
---|
20 |
|
---|
21 | /**
|
---|
22 | * Constructs a new {@code ChangesetDiscussionComment}.
|
---|
23 | * @param date date this comment was posted at
|
---|
24 | * @param user the user who posted the comment
|
---|
25 | */
|
---|
26 | public ChangesetDiscussionComment(Date date, User user) {
|
---|
27 | this.date = DateUtils.cloneDate(date);
|
---|
28 | this.user = user;
|
---|
29 | }
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * Replies comment text.
|
---|
33 | * @return comment text
|
---|
34 | */
|
---|
35 | public final String getText() {
|
---|
36 | return text;
|
---|
37 | }
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * Sets comment text.
|
---|
41 | * @param text comment text
|
---|
42 | */
|
---|
43 | public final void setText(String text) {
|
---|
44 | this.text = text;
|
---|
45 | }
|
---|
46 |
|
---|
47 | /**
|
---|
48 | * Replies date this comment was posted at.
|
---|
49 | * @return date this comment was posted at
|
---|
50 | */
|
---|
51 | public final Date getDate() {
|
---|
52 | return DateUtils.cloneDate(date);
|
---|
53 | }
|
---|
54 |
|
---|
55 | /**
|
---|
56 | * Replies the user who posted the comment.
|
---|
57 | * @return the user who posted the comment
|
---|
58 | */
|
---|
59 | public final User getUser() {
|
---|
60 | return user;
|
---|
61 | }
|
---|
62 |
|
---|
63 | @Override
|
---|
64 | public String toString() {
|
---|
65 | return "ChangesetDiscussionComment [date=" + date + ", user=" + user + ", text='" + text + "']";
|
---|
66 | }
|
---|
67 | }
|
---|