View Javadoc
1   /*
2    * Copyright 2007 Kasper B. Graversen
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.supercsv.mock;
17  
18  /**
19   * A bean to use when testing reflection.
20   * 
21   * @author James Bassett
22   */
23  public class ReflectionBean {
24  	
25  	private String name;
26  	private Number favouriteNumber;
27  	private Number overloaded;
28  	private boolean primitiveBoolean;
29  	private int primitiveInt;
30  	private short primitiveShort;
31  	private long primitiveLong;
32  	private double primitiveDouble;
33  	private float primitiveFloat;
34  	private char primitiveChar;
35  	private byte primitiveByte;
36  	private Boolean booleanWrapper;
37  	private Integer integerWrapper;
38  	private Short shortWrapper;
39  	private Long longWrapper;
40  	private Double doubleWrapper;
41  	private Float floatWrapper;
42  	private Character charWrapper;
43  	private Byte byteWrapper;
44  	private Boolean booleanWrapper2;
45  	private String URL;
46  	private String iPad;
47  	private boolean isTurkish;
48  	
49  	public String getName() {
50  		
51  		return name;
52  	}
53  	
54  	public void setName(String name) {
55  		this.name = name;
56  	}
57  	
58  	public Number getFavouriteNumber() {
59  		return favouriteNumber;
60  	}
61  	
62  	public void setFavouriteNumber(Number favouriteNumber) {
63  		this.favouriteNumber = favouriteNumber;
64  	}
65  	
66  	public Number getOverloaded() {
67  		return overloaded;
68  	}
69  	
70  	public void setOverloaded(Integer overloaded) {
71  		throw new RuntimeException("this overloaded setter shouldn't be invoked!");
72  	}
73  	
74  	public void setOverloaded(Number overloaded) {
75  		this.overloaded = overloaded;
76  	}
77  	
78  	public int getPrimitiveInt() {
79  		return primitiveInt;
80  	}
81  	
82  	public void setPrimitiveInt(int primitiveInt) {
83  		this.primitiveInt = primitiveInt;
84  	}
85  	
86  	public short getPrimitiveShort() {
87  		return primitiveShort;
88  	}
89  	
90  	public void setPrimitiveShort(short primitiveShort) {
91  		this.primitiveShort = primitiveShort;
92  	}
93  	
94  	public long getPrimitiveLong() {
95  		return primitiveLong;
96  	}
97  	
98  	public void setPrimitiveLong(long primitiveLong) {
99  		this.primitiveLong = primitiveLong;
100 	}
101 	
102 	public double getPrimitiveDouble() {
103 		return primitiveDouble;
104 	}
105 	
106 	public void setPrimitiveDouble(double primitiveDouble) {
107 		this.primitiveDouble = primitiveDouble;
108 	}
109 	
110 	public float getPrimitiveFloat() {
111 		return primitiveFloat;
112 	}
113 	
114 	public void setPrimitiveFloat(float primitiveFloat) {
115 		this.primitiveFloat = primitiveFloat;
116 	}
117 	
118 	public char getPrimitiveChar() {
119 		return primitiveChar;
120 	}
121 	
122 	public void setPrimitiveChar(char primitiveChar) {
123 		this.primitiveChar = primitiveChar;
124 	}
125 	
126 	public byte getPrimitiveByte() {
127 		return primitiveByte;
128 	}
129 	
130 	public void setPrimitiveByte(byte primitiveByte) {
131 		this.primitiveByte = primitiveByte;
132 	}
133 	
134 	public Integer getIntegerWrapper() {
135 		return integerWrapper;
136 	}
137 	
138 	public void setIntegerWrapper(Integer integerWrapper) {
139 		this.integerWrapper = integerWrapper;
140 	}
141 	
142 	public Short getShortWrapper() {
143 		return shortWrapper;
144 	}
145 	
146 	public void setShortWrapper(Short shortWrapper) {
147 		this.shortWrapper = shortWrapper;
148 	}
149 	
150 	public Long getLongWrapper() {
151 		return longWrapper;
152 	}
153 	
154 	public void setLongWrapper(Long longWrapper) {
155 		this.longWrapper = longWrapper;
156 	}
157 	
158 	public Double getDoubleWrapper() {
159 		return doubleWrapper;
160 	}
161 	
162 	public void setDoubleWrapper(Double doubleWrapper) {
163 		this.doubleWrapper = doubleWrapper;
164 	}
165 	
166 	public Float getFloatWrapper() {
167 		return floatWrapper;
168 	}
169 	
170 	public void setFloatWrapper(Float floatWrapper) {
171 		this.floatWrapper = floatWrapper;
172 	}
173 	
174 	public Character getCharWrapper() {
175 		return charWrapper;
176 	}
177 	
178 	public void setCharWrapper(Character charWrapper) {
179 		this.charWrapper = charWrapper;
180 	}
181 	
182 	public Byte getByteWrapper() {
183 		return byteWrapper;
184 	}
185 	
186 	public void setByteWrapper(Byte byteWrapper) {
187 		this.byteWrapper = byteWrapper;
188 	}
189 	
190 	public void getPrimitiveBoolean() {
191 		throw new RuntimeException("this method isn't a getter (no return type) and should never be invoked");
192 	}
193 	
194 	public boolean getPrimitiveBoolean(boolean dummy) {
195 		throw new RuntimeException("this method isn't a getter (it has a param) and should never be invoked");
196 	}
197 	
198 	public boolean isPrimitiveBoolean() {
199 		return primitiveBoolean;
200 	}
201 	
202 	public void setPrimitiveBoolean(boolean primitiveBoolean) {
203 		this.primitiveBoolean = primitiveBoolean;
204 	}
205 	
206 	public void setPrimitiveBoolean() {
207 		throw new RuntimeException("this method isn't a setter (no param) and should never be invoked");
208 	}
209 	
210 	public Boolean getBooleanWrapper() {
211 		return booleanWrapper;
212 	}
213 	
214 	public void setBooleanWrapper(Boolean booleanWrapper) {
215 		this.booleanWrapper = booleanWrapper;
216 	}
217 	
218 	public Boolean isBooleanWrapper2() {
219 		return booleanWrapper2;
220 	}
221 	
222 	public void setBooleanWrapper2(Boolean booleanWrapper2) {
223 		this.booleanWrapper2 = booleanWrapper2;
224 	}
225 	
226 	public String isInvalid() {
227 		throw new RuntimeException("this method isn't a getter and should never be invoked");
228 	}
229 	
230 	public String getURL() {
231 		return URL;
232 	}
233 
234 	public void setURL(String URL) {
235 		this.URL = URL;
236 	}
237 	
238 	public String getiPad() {
239 		return iPad;
240 	}
241 	
242 	public void setiPad(String iPad) {
243 		this.iPad = iPad;
244 	}
245 
246 	public boolean getIsTurkish() {
247 		return isTurkish;
248 	}
249 
250 	public void setIsTurkish(boolean isTurkish) {
251 		this.isTurkish = isTurkish;
252 	}
253 }