1 |
| package org.jboss.cache.util; |
2 |
| |
3 |
| import java.io.Serializable; |
4 |
| import java.util.Map; |
5 |
| import java.util.Map.Entry; |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| class SimpleEntry<K, V> implements Map.Entry<K, V>, Serializable |
11 |
| { |
12 |
| private static final long serialVersionUID = -6092752114794052323L; |
13 |
| |
14 |
| private K key; |
15 |
| |
16 |
| private V value; |
17 |
| |
18 |
204524994
| public SimpleEntry(Entry<K, V> me)
|
19 |
| { |
20 |
204524994
| key = me.getKey();
|
21 |
204524994
| value = me.getValue();
|
22 |
| } |
23 |
| |
24 |
0
| public SimpleEntry(K key, V value)
|
25 |
| { |
26 |
0
| this.key = key;
|
27 |
0
| this.value = value;
|
28 |
| } |
29 |
| |
30 |
378297
| public K getKey()
|
31 |
| { |
32 |
378297
| return key;
|
33 |
| } |
34 |
| |
35 |
377707
| public V getValue()
|
36 |
| { |
37 |
377707
| return value;
|
38 |
| } |
39 |
| |
40 |
1
| public V setValue(V arg0)
|
41 |
| { |
42 |
1
| throw new UnsupportedOperationException();
|
43 |
| } |
44 |
| |
45 |
0
| @Override
|
46 |
| public boolean equals(Object o) |
47 |
| { |
48 |
0
| Map.Entry e2 = (Map.Entry) o;
|
49 |
0
| return (getKey() == null ? e2.getKey() == null : getKey().equals(e2.getKey()))
|
50 |
0
| && (getValue() == null ? e2.getValue() == null : getValue().equals(e2.getValue()));
|
51 |
| } |
52 |
| |
53 |
101525
| @Override
|
54 |
| public int hashCode() |
55 |
| { |
56 |
101525
| return (getKey() == null ? 0 : getKey().hashCode()) ^
|
57 |
101525
| (getValue() == null ? 0 : getValue().hashCode());
|
58 |
| } |
59 |
| |
60 |
0
| @Override
|
61 |
| public String toString() |
62 |
| { |
63 |
0
| return key + "=" + value;
|
64 |
| } |
65 |
| } |