-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTransaction.java
More file actions
53 lines (53 loc) · 1.18 KB
/
Transaction.java
File metadata and controls
53 lines (53 loc) · 1.18 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
package Bank;
import java.time.LocalDateTime;
public class Transaction {
String tid;
String accno;
double amount;
String type;
LocalDateTime timestamp;
public String getTid() {
return tid;
}
public void setTid(String tid) {
this.tid = tid;
}
public String getAccno() {
return accno;
}
public void setAccno(String accno) {
this.accno = accno;
}
public double getAmount() {
return amount;
}
public void setAmount(double amount) {
this.amount = amount;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public LocalDateTime getTimestamp() {
return timestamp;
}
public void setTimestamp(LocalDateTime timestamp) {
this.timestamp = LocalDateTime.now();
}
public Transaction() {
super();
// TODO Auto-generated constructor stub
}
public Transaction(String accountNumber, double amount, String type) {
this.accno = accountNumber;
this.amount = amount;
this.type = type;
this.timestamp = LocalDateTime.now();
}
@Override
public String toString() {
return "-----Transaction-----\nTransaction ID : " + tid + "\nAccount Number : " + accno + "\nAmount : " + amount + "\nType : " + type;
}
}