1 18 19 package org.apache.struts.validator; 20 21 import java.util.Map ; 22 import java.util.HashMap ; 23 import junit.framework.Test; 24 import junit.framework.TestCase; 25 import junit.framework.TestSuite; 26 27 30 public class PojoBean { 31 32 protected String stringValue1; 33 34 protected String stringValue2; 35 36 protected int intValue1; 37 38 protected int intValue2; 39 40 protected Integer integerValue1; 41 42 protected Integer integerValue2; 43 44 protected PojoBean[] beans; 45 46 protected Map map = new HashMap (); 47 48 51 public PojoBean() { 52 } 53 54 57 public PojoBean(String stringValue1, String stringValue2) { 58 setStringValue1(stringValue1); 59 setStringValue2(stringValue2); 60 } 61 62 65 public PojoBean(int intValue1, int intValue2) { 66 setIntValue1(intValue1); 67 setIntValue2(intValue2); 68 setIntegerValue1(new Integer (intValue1)); 69 setIntegerValue2(new Integer (intValue2)); 70 } 71 72 75 public void setStringValue1(String stringValue1) { 76 this.stringValue1 = stringValue1; 77 } 78 79 82 public String getStringValue1() { 83 return stringValue1; 84 } 85 86 89 public void setStringValue2(String stringValue2) { 90 this.stringValue2 = stringValue2; 91 } 92 93 96 public String getStringValue2() { 97 return stringValue2; 98 } 99 100 103 public void setIntValue1(int intValue1) { 104 this.intValue1= intValue1; 105 } 106 107 110 public int getIntValue1() { 111 return intValue1; 112 } 113 114 117 public void setIntValue2(int intValue2) { 118 this.intValue2= intValue2; 119 } 120 121 124 public int getIntValue2() { 125 return intValue2; 126 } 127 128 131 public void setIntegerValue1(Integer integerValue1) { 132 this.integerValue1= integerValue1; 133 } 134 135 138 public Integer getIntegerValue1() { 139 return integerValue1; 140 } 141 142 145 public void setIntegerValue2(Integer integerValue2) { 146 this.integerValue2= integerValue2; 147 } 148 149 152 public Integer getIntegerValue2() { 153 return integerValue2; 154 } 155 156 159 public void setBeans(PojoBean[] beans) { 160 this.beans = beans; 161 } 162 163 166 public PojoBean[] getBeans() { 167 return beans; 168 } 169 170 173 public PojoBean getBean(int index) { 174 return beans[index]; 175 } 176 177 180 public Object getMap() { 181 return map; 182 } 183 184 187 public void setMap(Map map) { 188 this.map = map; 189 } 190 191 194 public void setMapped(String key, Object value) { 195 map.put(key, value); 196 } 197 198 201 public Object getMapped(String key) { 202 return map.get(key); 203 } 204 205 } 206 | Popular Tags |