Source Code Cross Referenced for MockBean4CodecPrimitives.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » beans » tests » support » mock » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » org package » org.apache.harmony.beans.tests.support.mock 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        package org.apache.harmony.beans.tests.support.mock;
019:
020:        import java.lang.reflect.Field;
021:        import java.util.Collection;
022:
023:        public class MockBean4CodecPrimitives {
024:
025:            boolean bool = true;
026:
027:            byte b = 1;
028:
029:            char c = 'a';
030:
031:            double d = 3.14;
032:
033:            float f = 3.14F;
034:
035:            int i = 4;
036:
037:            long l = 8;
038:
039:            short s = 2;
040:
041:            Boolean boolobj = Boolean.FALSE;
042:
043:            Byte bobj = new Byte((byte) 11);
044:
045:            Character cobj = new Character('A');
046:
047:            Double dobj = new Double(6.28);
048:
049:            Float fobj = new Float(6.28F);
050:
051:            Integer iobj = new Integer(44);
052:
053:            Long lobj = new Long(88);
054:
055:            Short sobj = new Short((short) 22);
056:
057:            Object nill = "start with not null";
058:
059:            Class<?> clazz = Collection.class;
060:
061:            int zarr[] = { 1, 2, 3, 4 };
062:
063:            String zarrarr[][] = { { "1", "2" }, { "3", "4", "5" } };
064:
065:            public MockBean4CodecPrimitives() {
066:                super ();
067:            }
068:
069:            @Override
070:            public boolean equals(Object obj) {
071:                if (obj == null || !getClass().equals(obj.getClass())) {
072:                    return false;
073:                }
074:                try {
075:                    Field fields[] = getClass().getDeclaredFields();
076:                    for (Field element : fields) {
077:                        Object mine = element.get(this );
078:                        Object other = element.get(obj);
079:                        if (mine == null ? other != null : !mine.equals(other)) {
080:                            return false;
081:                        }
082:                    }
083:                    return true;
084:                } catch (Exception e) {
085:                    throw new RuntimeException("impossible!!");
086:                }
087:            }
088:
089:            @Override
090:            public int hashCode() {
091:                try {
092:                    int code = 0;
093:                    Field fields[] = getClass().getDeclaredFields();
094:                    for (Field element : fields) {
095:                        Object mine = element.get(this );
096:                        if (mine != null) {
097:                            code += mine.hashCode();
098:                        }
099:                    }
100:                    return code;
101:                } catch (Exception e) {
102:                    throw new RuntimeException("impossible!!");
103:                }
104:            }
105:
106:            /**
107:             * @return Returns the b.
108:             */
109:            public byte getB() {
110:                return b;
111:            }
112:
113:            /**
114:             * @param b
115:             *            The b to set.
116:             */
117:            public void setB(byte b) {
118:                this .b = b;
119:            }
120:
121:            /**
122:             * @return Returns the bobj.
123:             */
124:            public Byte getBobj() {
125:                return bobj;
126:            }
127:
128:            /**
129:             * @param bobj
130:             *            The bobj to set.
131:             */
132:            public void setBobj(Byte bobj) {
133:                this .bobj = bobj;
134:            }
135:
136:            /**
137:             * @return Returns the bool.
138:             */
139:            public boolean isBool() {
140:                return bool;
141:            }
142:
143:            /**
144:             * @param bool
145:             *            The bool to set.
146:             */
147:            public void setBool(boolean bool) {
148:                this .bool = bool;
149:            }
150:
151:            /**
152:             * @return Returns the boolobj.
153:             */
154:            public Boolean getBoolobj() {
155:                return boolobj;
156:            }
157:
158:            /**
159:             * @param boolobj
160:             *            The boolobj to set.
161:             */
162:            public void setBoolobj(Boolean boolobj) {
163:                this .boolobj = boolobj;
164:            }
165:
166:            /**
167:             * @return Returns the c.
168:             */
169:            public char getC() {
170:                return c;
171:            }
172:
173:            /**
174:             * @param c
175:             *            The c to set.
176:             */
177:            public void setC(char c) {
178:                this .c = c;
179:            }
180:
181:            /**
182:             * @return Returns the cobj.
183:             */
184:            public Character getCobj() {
185:                return cobj;
186:            }
187:
188:            /**
189:             * @param cobj
190:             *            The cobj to set.
191:             */
192:            public void setCobj(Character cobj) {
193:                this .cobj = cobj;
194:            }
195:
196:            /**
197:             * @return Returns the d.
198:             */
199:            public double getD() {
200:                return d;
201:            }
202:
203:            /**
204:             * @param d
205:             *            The d to set.
206:             */
207:            public void setD(double d) {
208:                this .d = d;
209:            }
210:
211:            /**
212:             * @return Returns the dobj.
213:             */
214:            public Double getDobj() {
215:                return dobj;
216:            }
217:
218:            /**
219:             * @param dobj
220:             *            The dobj to set.
221:             */
222:            public void setDobj(Double dobj) {
223:                this .dobj = dobj;
224:            }
225:
226:            /**
227:             * @return Returns the f.
228:             */
229:            public float getF() {
230:                return f;
231:            }
232:
233:            /**
234:             * @param f
235:             *            The f to set.
236:             */
237:            public void setF(float f) {
238:                this .f = f;
239:            }
240:
241:            /**
242:             * @return Returns the fobj.
243:             */
244:            public Float getFobj() {
245:                return fobj;
246:            }
247:
248:            /**
249:             * @param fobj
250:             *            The fobj to set.
251:             */
252:            public void setFobj(Float fobj) {
253:                this .fobj = fobj;
254:            }
255:
256:            /**
257:             * @return Returns the i.
258:             */
259:            public int getI() {
260:                return i;
261:            }
262:
263:            /**
264:             * @param i
265:             *            The i to set.
266:             */
267:            public void setI(int i) {
268:                this .i = i;
269:            }
270:
271:            /**
272:             * @return Returns the iobj.
273:             */
274:            public Integer getIobj() {
275:                return iobj;
276:            }
277:
278:            /**
279:             * @param iobj
280:             *            The iobj to set.
281:             */
282:            public void setIobj(Integer iobj) {
283:                this .iobj = iobj;
284:            }
285:
286:            /**
287:             * @return Returns the l.
288:             */
289:            public long getL() {
290:                return l;
291:            }
292:
293:            /**
294:             * @param l
295:             *            The l to set.
296:             */
297:            public void setL(long l) {
298:                this .l = l;
299:            }
300:
301:            /**
302:             * @return Returns the lobj.
303:             */
304:            public Long getLobj() {
305:                return lobj;
306:            }
307:
308:            /**
309:             * @param lobj
310:             *            The lobj to set.
311:             */
312:            public void setLobj(Long lobj) {
313:                this .lobj = lobj;
314:            }
315:
316:            /**
317:             * @return Returns the nill.
318:             */
319:            public Object getNill() {
320:                return nill;
321:            }
322:
323:            /**
324:             * @param nill
325:             *            The nill to set.
326:             */
327:            public void setNill(Object nill) {
328:                this .nill = nill;
329:            }
330:
331:            /**
332:             * @return Returns the s.
333:             */
334:            public short getS() {
335:                return s;
336:            }
337:
338:            /**
339:             * @param s
340:             *            The s to set.
341:             */
342:            public void setS(short s) {
343:                this .s = s;
344:            }
345:
346:            /**
347:             * @return Returns the sobj.
348:             */
349:            public Short getSobj() {
350:                return sobj;
351:            }
352:
353:            /**
354:             * @param sobj
355:             *            The sobj to set.
356:             */
357:            public void setSobj(Short sobj) {
358:                this .sobj = sobj;
359:            }
360:
361:            /**
362:             * @return Returns the clazz.
363:             */
364:            public Class<?> getClazz() {
365:                return clazz;
366:            }
367:
368:            /**
369:             * @param clazz
370:             *            The clazz to set.
371:             */
372:            public void setClazz(Class<?> clazz) {
373:                this .clazz = clazz;
374:            }
375:
376:            /**
377:             * @return Returns the zarr.
378:             */
379:            public int[] getZarr() {
380:                return zarr;
381:            }
382:
383:            /**
384:             * @param arr
385:             *            The zarr to set.
386:             */
387:            public void setZarr(int[] arr) {
388:                this .zarr = arr;
389:            }
390:
391:            /**
392:             * @return Returns the zarrarr.
393:             */
394:            public String[][] getZarrarr() {
395:                return zarrarr;
396:            }
397:
398:            /**
399:             * @param arrarr
400:             *            The zarrarr to set.
401:             */
402:            public void setZarrarr(String[][] arrarr) {
403:                this.zarrarr = arrarr;
404:            }
405:        }
w___ww.j__av___a_2___s___.__c__o___m___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.