01: /*
02: * Copyright (C) 2006 Joe Walnes.
03: * Copyright (C) 2006, 2007 XStream Committers.
04: * All rights reserved.
05: *
06: * The software in this package is published under the terms of the BSD
07: * style license a copy of which has been included with this distribution in
08: * the LICENSE.txt file.
09: *
10: * Created on 15. July 2006 by Joe Walnes
11: */
12: package com.thoughtworks.xstream.tools.benchmark.targets;
13:
14: import com.thoughtworks.xstream.tools.benchmark.Target;
15:
16: import java.util.Date;
17:
18: /**
19: * A user defined class ({@link Person}) to serialize that contains a few simple fields.
20: *
21: * @author Joe Walnes
22: * @see com.thoughtworks.xstream.tools.benchmark.Harness
23: * @see Target
24: */
25: public class UserDefinedClassTarget implements Target {
26:
27: private final Person person;
28:
29: public UserDefinedClassTarget() {
30: person = new Person();
31: person.firstName = "Joe";
32: person.lastName = "Walnes";
33: person.dateOfBirth = new Date();
34: }
35:
36: public String toString() {
37: return "User defined class";
38: }
39:
40: public Object target() {
41: return person;
42: }
43:
44: public boolean isEqual(Object other) {
45: return person.equals(other);
46: }
47: }
|