5376 |
23 Apr 19 |
nicklas |
1 |
package net.sf.basedb.reggie.activity; |
5376 |
23 Apr 19 |
nicklas |
2 |
|
5376 |
23 Apr 19 |
nicklas |
3 |
import java.util.Date; |
5376 |
23 Apr 19 |
nicklas |
4 |
|
5376 |
23 Apr 19 |
nicklas |
5 |
/** |
5376 |
23 Apr 19 |
nicklas |
A simple activity entry that can't be merged with other activities. |
5376 |
23 Apr 19 |
nicklas |
7 |
|
5376 |
23 Apr 19 |
nicklas |
@author nicklas |
5376 |
23 Apr 19 |
nicklas |
@since 4.23 |
5376 |
23 Apr 19 |
nicklas |
10 |
*/ |
5376 |
23 Apr 19 |
nicklas |
11 |
public class SimpleActivity |
5376 |
23 Apr 19 |
nicklas |
12 |
implements ActivityEntry |
5376 |
23 Apr 19 |
nicklas |
13 |
{ |
5376 |
23 Apr 19 |
nicklas |
14 |
private static final long serialVersionUID = 7486620618215447911L; |
5376 |
23 Apr 19 |
nicklas |
15 |
|
5376 |
23 Apr 19 |
nicklas |
16 |
private final Date date; |
5376 |
23 Apr 19 |
nicklas |
17 |
private final String message; |
5421 |
13 May 19 |
nicklas |
18 |
private String user; |
5421 |
13 May 19 |
nicklas |
19 |
private String project; |
5376 |
23 Apr 19 |
nicklas |
20 |
|
5421 |
13 May 19 |
nicklas |
21 |
public SimpleActivity(String message, String user, String project) |
5376 |
23 Apr 19 |
nicklas |
22 |
{ |
5384 |
26 Apr 19 |
nicklas |
23 |
this.date = new Date(); |
5376 |
23 Apr 19 |
nicklas |
24 |
this.message = message; |
5421 |
13 May 19 |
nicklas |
25 |
this.user = user; |
5421 |
13 May 19 |
nicklas |
26 |
this.project = project; |
5376 |
23 Apr 19 |
nicklas |
27 |
} |
5376 |
23 Apr 19 |
nicklas |
28 |
|
5376 |
23 Apr 19 |
nicklas |
29 |
@Override |
5376 |
23 Apr 19 |
nicklas |
30 |
public Date getEventDate() |
5376 |
23 Apr 19 |
nicklas |
31 |
{ |
5376 |
23 Apr 19 |
nicklas |
32 |
return date; |
5376 |
23 Apr 19 |
nicklas |
33 |
} |
5376 |
23 Apr 19 |
nicklas |
34 |
|
5376 |
23 Apr 19 |
nicklas |
35 |
@Override |
5376 |
23 Apr 19 |
nicklas |
36 |
public String getMessage() |
5376 |
23 Apr 19 |
nicklas |
37 |
{ |
5376 |
23 Apr 19 |
nicklas |
38 |
return message; |
5376 |
23 Apr 19 |
nicklas |
39 |
} |
5421 |
13 May 19 |
nicklas |
40 |
|
5421 |
13 May 19 |
nicklas |
41 |
@Override |
5421 |
13 May 19 |
nicklas |
42 |
public String getUser() |
5421 |
13 May 19 |
nicklas |
43 |
{ |
5421 |
13 May 19 |
nicklas |
44 |
return user; |
5421 |
13 May 19 |
nicklas |
45 |
} |
5421 |
13 May 19 |
nicklas |
46 |
|
5421 |
13 May 19 |
nicklas |
47 |
@Override |
5421 |
13 May 19 |
nicklas |
48 |
public String getProject() |
5421 |
13 May 19 |
nicklas |
49 |
{ |
5421 |
13 May 19 |
nicklas |
50 |
return project; |
5421 |
13 May 19 |
nicklas |
51 |
} |
5376 |
23 Apr 19 |
nicklas |
52 |
|
5376 |
23 Apr 19 |
nicklas |
53 |
@Override |
5376 |
23 Apr 19 |
nicklas |
54 |
public boolean canMerge() |
5376 |
23 Apr 19 |
nicklas |
55 |
{ |
5376 |
23 Apr 19 |
nicklas |
56 |
return false; |
5376 |
23 Apr 19 |
nicklas |
57 |
} |
5376 |
23 Apr 19 |
nicklas |
58 |
|
5376 |
23 Apr 19 |
nicklas |
59 |
@Override |
5376 |
23 Apr 19 |
nicklas |
60 |
public boolean merge(ActivityEntry activity) |
5376 |
23 Apr 19 |
nicklas |
61 |
{ |
5376 |
23 Apr 19 |
nicklas |
62 |
return false; |
5376 |
23 Apr 19 |
nicklas |
63 |
} |
5376 |
23 Apr 19 |
nicklas |
64 |
|
5376 |
23 Apr 19 |
nicklas |
65 |
@Override |
5376 |
23 Apr 19 |
nicklas |
66 |
public String toString() |
5376 |
23 Apr 19 |
nicklas |
67 |
{ |
5376 |
23 Apr 19 |
nicklas |
68 |
return "SimpleActivity["+getEventDate()+"] "+getMessage(); |
5376 |
23 Apr 19 |
nicklas |
69 |
} |
5421 |
13 May 19 |
nicklas |
70 |
|
5421 |
13 May 19 |
nicklas |
71 |
|
5421 |
13 May 19 |
nicklas |
72 |
public SimpleActivity setUser(String user) |
5421 |
13 May 19 |
nicklas |
73 |
{ |
5421 |
13 May 19 |
nicklas |
74 |
this.user = user; |
5421 |
13 May 19 |
nicklas |
75 |
return this; |
5421 |
13 May 19 |
nicklas |
76 |
} |
5421 |
13 May 19 |
nicklas |
77 |
|
5421 |
13 May 19 |
nicklas |
78 |
public SimpleActivity setProject(String project) |
5421 |
13 May 19 |
nicklas |
79 |
{ |
5421 |
13 May 19 |
nicklas |
80 |
this.project = project; |
5421 |
13 May 19 |
nicklas |
81 |
return this; |
5421 |
13 May 19 |
nicklas |
82 |
} |
5376 |
23 Apr 19 |
nicklas |
83 |
|
5421 |
13 May 19 |
nicklas |
84 |
|
5376 |
23 Apr 19 |
nicklas |
85 |
} |