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.model;
12:
13: import org.apache.commons.lang.builder.EqualsBuilder;
14: import org.apache.commons.lang.builder.HashCodeBuilder;
15:
16: import java.io.IOException;
17: import java.io.ObjectInputStream;
18: import java.io.ObjectOutputStream;
19: import java.io.Serializable;
20:
21: public class SerializableOne implements Serializable {
22:
23: private static final long serialVersionUID = 1L;
24:
25: private String one;
26:
27: public SerializableOne(String one) {
28: this .one = one;
29: }
30:
31: private void writeObject(final ObjectOutputStream out)
32: throws IOException {
33: out.defaultWriteObject();
34: }
35:
36: private void readObject(final ObjectInputStream in)
37: throws IOException, ClassNotFoundException {
38: in.defaultReadObject();
39: }
40:
41: public boolean equals(Object obj) {
42: return EqualsBuilder.reflectionEquals(this , obj);
43: }
44:
45: public int hashCode() {
46: return HashCodeBuilder.reflectionHashCode(this);
47: }
48: }
|