1 package locklib;
2
3 import ensure.Ensure;
4
5
6
7
8
9
10 public class LockRequest<LockType> {
11
12
13
14 private LockType m_type;
15
16
17
18
19 private Object m_holder;
20
21
22
23
24
25
26 public LockRequest(LockType type, Object h) {
27 Ensure.not_null(type, "type == null");
28 Ensure.not_null(h, "h == null");
29
30 m_type = type;
31 m_holder = h;
32 }
33
34
35
36
37
38 public LockType type() {
39 return m_type;
40 }
41
42
43
44
45
46 public Object holder() {
47 return m_holder;
48 }
49
50 @Override
51 public String toString() {
52 return "LockRequest[type=" + m_type + ", holder=" + m_holder + "]";
53 }
54 }