equal
deleted
inserted
replaced
35 * If you write code that depends on this, you do so at your own risk. |
35 * If you write code that depends on this, you do so at your own risk. |
36 * This code and its internal interfaces are subject to change or |
36 * This code and its internal interfaces are subject to change or |
37 * deletion without notice.</b> |
37 * deletion without notice.</b> |
38 */ |
38 */ |
39 public class Context { |
39 public class Context { |
|
40 |
|
41 Map<Class<?>, Object> map; |
|
42 |
40 public Context() { |
43 public Context() { |
41 map = new HashMap<Class<?>, Object>(); |
44 map = new HashMap<>(); |
42 } |
45 } |
43 |
46 |
44 @SuppressWarnings("unchecked") |
47 @SuppressWarnings("unchecked") |
45 public <T> T get(Class<T> key) { |
48 public <T> T get(Class<T> key) { |
46 return (T) map.get(key); |
49 return (T) map.get(key); |
48 |
51 |
49 @SuppressWarnings("unchecked") |
52 @SuppressWarnings("unchecked") |
50 public <T> T put(Class<T> key, T value) { |
53 public <T> T put(Class<T> key, T value) { |
51 return (T) map.put(key, value); |
54 return (T) map.put(key, value); |
52 } |
55 } |
53 |
|
54 Map<Class<?>, Object> map; |
|
55 } |
56 } |