-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathActivity.java
More file actions
89 lines (71 loc) · 2.58 KB
/
Copy pathActivity.java
File metadata and controls
89 lines (71 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package com.securefileshare.models;
import java.sql.Timestamp;
public class Activity {
private int id;
private int userId;
private String type;
private String description;
private Timestamp timestamp;
private String action;
private String ipAddress;
private String status;
private String username;
// Constructors
public Activity() {}
public Activity(int id, int userId, String type, String description, Timestamp timestamp) {
this.id = id;
this.userId = userId;
this.type = type;
this.description = description;
this.timestamp = timestamp;
}
// Simplified constructor for default activities
public Activity(String type, String description, Timestamp timestamp) {
this(0, 0, type, description, timestamp);
}
// Getters and Setters
public int getId() { return id; }
public void setId(int id) { this.id = id; }
public int getUserId() { return userId; }
public void setUserId(int userId) { this.userId = userId; }
public String getType() { return type; }
public void setType(String type) { this.type = type; }
public String getDescription() { return description; }
public void setDescription(String description) { this.description = description; }
public Timestamp getTimestamp() { return timestamp; }
public void setTimestamp(Timestamp timestamp) { this.timestamp = timestamp; }
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getFormattedTimestamp() {
if (timestamp == null) return "";
return new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(timestamp);
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public String toString() {
return "Activity{" +
"id=" + id +
", userId=" + userId +
", action='" + action + '\'' +
", description='" + description + '\'' +
", timestamp=" + timestamp +
", ipAddress='" + ipAddress + '\'' +
", status='" + status + '\'' +
'}';
}
}