-
Notifications
You must be signed in to change notification settings - Fork 0
/
TranslationMessage.java
63 lines (52 loc) · 1.67 KB
/
TranslationMessage.java
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
package blockchain;
import java.security.PublicKey;
public class TranslationMessage {
private final int id;
private final PublicKey publicKey;
private final byte[] signature;
private final Man expendMan;
private final Man incomeMan;
private final int money;
private final int expendManMokey;
TranslationMessage(int id, PublicKey publicKey, byte[] signature, Man expendMan, Man incomeMan, int money) {
this.id = id;
this.publicKey = publicKey;
this.expendMan = expendMan;
this.signature = signature;
this.incomeMan = incomeMan;
this.money = money;
this.expendManMokey = expendMan.getMoney();
}
public Man getExpendMan() {
return expendMan;
}
public Man getIncomeMan() {
return incomeMan;
}
public int getId() {
return id;
}
public PublicKey getPublicKey() {
return publicKey;
}
public byte[] getSignature() {
return signature;
}
public int getExpendManId() {
return expendMan.getId();
}
public int getIncomeManId() {
return incomeMan.getId();
}
public int getMoney() {
return money;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("#").append(id).append(" ").append(expendMan.getSocialStatus()).append(expendMan.getId()).append("'s money: ").append(expendManMokey).append("\n");
sb.append(expendMan.getSocialStatus()).append(expendMan.getId()).append(" send ").append(money)
.append(" VC TO ").append(incomeMan.getSocialStatus()).append(incomeMan.getId());
return sb.toString();
}
}