KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > mx > mxbean > support > SimpleInterface


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2006, JBoss Inc., and individual contributors as indicated
4  * by the @authors tag. See the copyright.txt in the distribution for a
5  * full listing of individual contributors.
6  *
7  * This is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation; either version 2.1 of
10  * the License, or (at your option) any later version.
11  *
12  * This software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this software; if not, write to the Free
19  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21  */

22 package org.jboss.test.mx.mxbean.support;
23
24 import java.math.BigDecimal JavaDoc;
25 import java.math.BigInteger JavaDoc;
26 import java.util.Date JavaDoc;
27
28 import javax.management.ObjectName JavaDoc;
29
30 import org.jboss.mx.util.ObjectNameFactory;
31 import org.jboss.test.mx.mxbean.test.AbstractMXBeanTest;
32
33 /**
34  * SimpleInterface.
35  *
36  * @author <a HREF="adrian@jboss.com">Adrian Brock</a>
37  * @version $Revision: 1.1 $
38  */

39 public interface SimpleInterface
40 {
41    String JavaDoc BIG_DECIMAL = "bigDecimal";
42
43    BigDecimal JavaDoc bigDecimalValue = new BigDecimal JavaDoc("12e4");
44    BigDecimal JavaDoc bigDecimalChangedValue = new BigDecimal JavaDoc("12e5");
45
46    String JavaDoc BIG_INTEGER = "bigInteger";
47
48    BigInteger JavaDoc bigIntegerValue = new BigInteger JavaDoc("123456");
49    BigInteger JavaDoc bigIntegerChangedValue = new BigInteger JavaDoc("123457");
50
51    String JavaDoc BOOLEAN = "boolean";
52
53    Boolean JavaDoc booleanValue = Boolean.TRUE;
54    Boolean JavaDoc booleanChangedValue = Boolean.FALSE;
55
56    String JavaDoc BOOLEAN_PRIMITIVE = "primitiveBoolean";
57
58    boolean primitiveBooleanValue = booleanValue.booleanValue();
59    boolean primitiveBooleanChangedValue = booleanChangedValue.booleanValue();
60
61    String JavaDoc BYTE = "byte";
62
63    Byte JavaDoc byteValue = new Byte JavaDoc("12");
64    Byte JavaDoc byteChangedValue = new Byte JavaDoc("13");
65
66    String JavaDoc BYTE_PRIMITIVE = "primitiveByte";
67
68    byte primitiveByteValue = byteValue.byteValue();
69    byte primitiveByteChangedValue = byteChangedValue.byteValue();
70
71    String JavaDoc CHARACTER = "character";
72
73    Character JavaDoc characterValue = new Character JavaDoc('a');
74    Character JavaDoc characterChangedValue = new Character JavaDoc('b');
75
76    String JavaDoc CHAR_PRIMITIVE = "primitiveChar";
77
78    char primitiveCharValue = characterValue.charValue();
79    char primitiveCharChangedValue = characterChangedValue.charValue();
80
81    String JavaDoc DATE = "date";
82
83    Date JavaDoc dateValue = AbstractMXBeanTest.createDate(2001, 1, 1);
84    Date JavaDoc dateChangedValue = AbstractMXBeanTest.createDate(2002, 2, 2);
85
86    String JavaDoc DOUBLE = "double";
87
88    Double JavaDoc doubleValue = new Double JavaDoc("3.14e12");
89    Double JavaDoc doubleChangedValue = new Double JavaDoc("3.14e13");
90
91    String JavaDoc DOUBLE_PRIMITIVE = "primitiveDouble";
92
93    double primitiveDoubleValue = doubleValue.doubleValue();
94    double primitiveDoubleChangedValue = doubleChangedValue.doubleValue();
95
96    String JavaDoc FLOAT = "float";
97
98    Float JavaDoc floatValue = new Float JavaDoc("3.14");
99    Float JavaDoc floatChangedValue = new Float JavaDoc("3.15");
100
101    String JavaDoc FLOAT_PRIMITIVE = "primitiveFloat";
102
103    float primitiveFloatValue = floatValue.floatValue();
104    float primitiveFloatChangedValue = floatChangedValue.floatValue();
105
106    String JavaDoc INTEGER = "integer";
107
108    Integer JavaDoc integerValue = new Integer JavaDoc("1234");
109    Integer JavaDoc integerChangedValue = new Integer JavaDoc("1235");
110
111    String JavaDoc INT_PRIMITIVE = "primitiveInt";
112
113    int primitiveIntValue = integerValue.intValue();
114    int primitiveIntChangedValue = integerChangedValue.intValue();
115
116    String JavaDoc LONG = "long";
117
118    Long JavaDoc longValue = new Long JavaDoc("12345");
119    Long JavaDoc longChangedValue = new Long JavaDoc("12346");
120
121    String JavaDoc LONG_PRIMITIVE = "primitiveLong";
122
123    long primitiveLongValue = longValue.longValue();
124    long primitiveLongChangedValue = longChangedValue.longValue();
125
126    String JavaDoc OBJECT_NAME = "objectName";
127
128    ObjectName JavaDoc objectNameValue = ObjectNameFactory.create("domain:key=property");
129    ObjectName JavaDoc objectNameChangedValue = ObjectNameFactory.create("domain:key=property2");
130
131    String JavaDoc SHORT = "short";
132
133    Short JavaDoc shortValue = new Short JavaDoc("123");
134    Short JavaDoc shortChangedValue = new Short JavaDoc("124");
135
136    String JavaDoc SHORT_PRIMITIVE = "primitiveShort";
137
138    short primitiveShortValue = shortValue.shortValue();
139    short primitiveShortChangedValue = shortChangedValue.shortValue();
140
141    String JavaDoc STRING = "string";
142
143    String JavaDoc stringValue = new String JavaDoc("StringValue");
144    String JavaDoc stringChangedValue = new String JavaDoc("ChangedValue");
145
146    String JavaDoc[] KEYS =
147    {
148       BIG_DECIMAL,
149       BIG_INTEGER,
150       BOOLEAN,
151       BOOLEAN_PRIMITIVE,
152       BYTE,
153       BYTE_PRIMITIVE,
154       CHARACTER,
155       CHAR_PRIMITIVE,
156       DATE,
157       DOUBLE,
158       DOUBLE_PRIMITIVE,
159       FLOAT,
160       FLOAT_PRIMITIVE,
161       INTEGER,
162       INT_PRIMITIVE,
163       LONG,
164       LONG_PRIMITIVE,
165       OBJECT_NAME,
166       SHORT,
167       SHORT_PRIMITIVE,
168       STRING
169    };
170
171    Object JavaDoc[] VALUES =
172    {
173       bigDecimalValue,
174       bigIntegerValue,
175       booleanValue,
176       primitiveBooleanValue,
177       byteValue,
178       primitiveByteValue,
179       characterValue,
180       primitiveCharValue,
181       dateValue,
182       doubleValue,
183       primitiveDoubleValue,
184       floatValue,
185       primitiveFloatValue,
186       integerValue,
187       primitiveIntValue,
188       longValue,
189       primitiveLongValue,
190       objectNameValue,
191       shortValue,
192       primitiveShortValue,
193       stringValue
194    };
195
196    Object JavaDoc[] CHANGED_VALUES =
197    {
198       bigDecimalChangedValue,
199       bigIntegerChangedValue,
200       booleanChangedValue,
201       primitiveBooleanChangedValue,
202       byteChangedValue,
203       primitiveByteChangedValue,
204       characterChangedValue,
205       primitiveCharChangedValue,
206       dateChangedValue,
207       doubleChangedValue,
208       primitiveDoubleChangedValue,
209       floatChangedValue,
210       primitiveFloatChangedValue,
211       integerChangedValue,
212       primitiveIntChangedValue,
213       longChangedValue,
214       primitiveLongChangedValue,
215       objectNameChangedValue,
216       shortChangedValue,
217       primitiveShortChangedValue,
218       stringChangedValue
219    };
220
221    Class JavaDoc[] TYPES =
222    {
223       BigDecimal JavaDoc.class,
224       BigInteger JavaDoc.class,
225       Boolean JavaDoc.class,
226       Boolean.TYPE,
227       Byte JavaDoc.class,
228       Byte.TYPE,
229       Character JavaDoc.class,
230       Character.TYPE,
231       Date JavaDoc.class,
232       Double JavaDoc.class,
233       Double.TYPE,
234       Float JavaDoc.class,
235       Float.TYPE,
236       Integer JavaDoc.class,
237       Integer.TYPE,
238       Long JavaDoc.class,
239       Long.TYPE,
240       ObjectName JavaDoc.class,
241       Short JavaDoc.class,
242       Short.TYPE,
243       String JavaDoc.class
244    };
245    
246    Object JavaDoc[] NULL_VALUES =
247    {
248       null,
249       null,
250       null,
251       null,
252       null,
253       null,
254       null,
255       null,
256       null,
257       null,
258       null,
259       null,
260       null,
261       null,
262       null,
263       null,
264       null,
265       null,
266       null,
267       null,
268       null
269    };
270    
271    Object JavaDoc[] LEGAL_NULL_VALUES =
272    {
273       null,
274       null,
275       null,
276       primitiveBooleanValue,
277       null,
278       primitiveByteValue,
279       null,
280       primitiveCharValue,
281       null,
282       null,
283       primitiveDoubleValue,
284       null,
285       primitiveFloatValue,
286       null,
287       primitiveIntValue,
288       null,
289       primitiveLongValue,
290       null,
291       null,
292       primitiveShortValue,
293       null,
294    };
295
296    BigDecimal JavaDoc getBigDecimal();
297
298    BigInteger JavaDoc getBigInteger();
299
300    boolean isPrimitiveBoolean();
301
302    Boolean JavaDoc getBoolean();
303
304    byte getPrimitiveByte();
305
306    Byte JavaDoc getByte();
307
308    char getPrimitiveChar();
309
310    Character JavaDoc getCharacter();
311
312    Date JavaDoc getDate();
313
314    double getPrimitiveDouble();
315
316    Double JavaDoc getDouble();
317
318    float getPrimitiveFloat();
319
320    Float JavaDoc getFloat();
321
322    int getPrimitiveInt();
323
324    Integer JavaDoc getInteger();
325
326    long getPrimitiveLong();
327
328    Long JavaDoc getLong();
329
330    ObjectName JavaDoc getObjectName();
331
332    short getPrimitiveShort();
333
334    Short JavaDoc getShort();
335
336    String JavaDoc getString();
337 }
338
Popular Tags