-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB.java
More file actions
80 lines (61 loc) · 1.35 KB
/
Copy pathB.java
File metadata and controls
80 lines (61 loc) · 1.35 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
package com.caozj.test;
import java.io.Serializable;
import java.util.Date;
import com.caozj.framework.util.common.SerializeUtil;
public class B implements Serializable {
private static final long serialVersionUID = 1L;
private String bName;
private A a;
private En en;
private Date d;
public En getEn() {
return en;
}
public void setEn(En en) {
this.en = en;
}
public Date getD() {
return d;
}
public void setD(Date d) {
this.d = d;
}
public String getbName() {
return bName;
}
public void setbName(String bName) {
this.bName = bName;
}
public A getA() {
return a;
}
public void setA(A a) {
this.a = a;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("B [bName=");
builder.append(bName);
builder.append(", a=");
builder.append(a);
builder.append(", en=");
builder.append(en);
builder.append(", d=");
builder.append(d);
builder.append("]");
return builder.toString();
}
public static void main(String[] args) {
A a = new A();
B b = new B();
b.setA(a);
b.setbName("b");
a.setBirthday(new Date());
a.setId(99);
a.setName("a");
byte[] bs = SerializeUtil.serialize(b);
B rb = (B) SerializeUtil.unserialize(bs);
System.out.println(rb.toString());
}
}