1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.commons.beanutils;
20
21 import java.util.HashMap;
22 import java.util.Map;
23
24
25
26
27
28
29
30 public class MappedPropertyTestBean {
31
32 private final Map<Object, Object> map = new HashMap<Object, Object>();
33 private final Map<Object, Object> myMap = new HashMap<Object, Object>();
34
35
36
37
38 public String getMapproperty(final String key) {
39 return (String) map.get(key);
40 }
41
42 public void setMapproperty(final String key, final String value) {
43 map.put(key, value);
44 }
45
46 public boolean isMappedBoolean(final String key) {
47 return ((Boolean)map.get(key)).booleanValue();
48 }
49
50 public void setMappedBoolean(final String key, final boolean value) {
51 map.put(key, (value ? Boolean.TRUE : Boolean.FALSE));
52 }
53
54 protected String getProtectedMapped(final String key) {
55 return (String) map.get(key);
56 }
57
58 protected void setProtectedMapped(final String key, final String value) {
59 map.put(key, value);
60 }
61
62 public void setMappedPrimitive(final int key, final int value) {
63 map.put(new Integer(key), new Integer(value));
64 }
65
66 public void setAnyMapped(final MappedPropertyTestBean key, final MappedPropertyTestBean value) {
67 map.put(key, value);
68 }
69
70 public void setMappedSetterOnly(final String key, final String value) {
71 map.put(key, value);
72 }
73
74 public String getMappedGetterOnly(final String key) {
75 return (String) map.get(key);
76 }
77
78 public String getInvalidGetter(final String key, final String other) {
79 return (String) map.get(key);
80 }
81 public Map<Object, Object> getMyMap() {
82 return myMap;
83 }
84
85 public void setInvalidGetter(final String key, final String value) {
86 map.put(key, value);
87 }
88 public String getInvalidSetter(final String key) {
89 return (String) map.get(key);
90 }
91 public void setInvalidSetter(final String key, final String value, final String other) {
92 }
93
94 public Long getDifferentTypes(final String key) {
95 return new Long(((Number)map.get(key)).longValue());
96 }
97 public void setDifferentTypes(final String key, final Integer value) {
98 map.put(key, value);
99 }
100
101 }