com.thoughtworks.xstream.tools.benchmark.targets.Person Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xstream-benchmark Show documentation
Show all versions of xstream-benchmark Show documentation
Benchmark suite of XStream.
package com.thoughtworks.xstream.tools.benchmark.targets;
import java.util.Date;
import java.io.Serializable;
/**
* @see UserDefinedClassTarget
*/
public class Person implements Serializable {
public String firstName;
public String lastName;
public Date dateOfBirth;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final Person person = (Person) o;
if (dateOfBirth != null ? !dateOfBirth.equals(person.dateOfBirth) : person.dateOfBirth != null) return false;
if (firstName != null ? !firstName.equals(person.firstName) : person.firstName != null) return false;
return !(lastName != null ? !lastName.equals(person.lastName) : person.lastName != null);
}
public int hashCode() {
int result;
result = (firstName != null ? firstName.hashCode() : 0);
result = 29 * result + (lastName != null ? lastName.hashCode() : 0);
result = 29 * result + (dateOfBirth != null ? dateOfBirth.hashCode() : 0);
return result;
}
}