01: /*
02: * Copyright (C) 2008 XStream Committers.
03: * All rights reserved.
04: *
05: * The software in this package is published under the terms of the BSD
06: * style license a copy of which has been included with this distribution in
07: * the LICENSE.txt file.
08: *
09: * Created on 01. January 2008 by Joerg Schaible
10: */
11: package com.thoughtworks.xstream.benchmark.cache.targets;
12:
13: import com.thoughtworks.xstream.benchmark.cache.model.Five;
14: import com.thoughtworks.xstream.benchmark.cache.model.One;
15: import com.thoughtworks.xstream.tools.benchmark.Target;
16:
17: import java.util.ArrayList;
18: import java.util.List;
19:
20: /**
21: * Target containing basic types.
22: *
23: * @author Jörg Schaible
24: * @since 1.3
25: */
26: public class ReflectionTarget implements Target {
27:
28: private List list;
29:
30: public ReflectionTarget() {
31: list = new ArrayList();
32: for (int i = 0; i < 5; ++i) {
33: list.add(new One(Integer.toString(i)));
34: }
35: list.add(new Five("1", 2, true, '4', new StringBuffer("5")));
36: }
37:
38: public boolean isEqual(Object other) {
39: return list.equals(other);
40: }
41:
42: public Object target() {
43: return list;
44: }
45:
46: public String toString() {
47: return "Reflection types";
48: }
49: }
|