restbasics1/src/main/java/de/lusiardi/testprojekt/dto/PersonCreateDto.java
2013-08-10 20:53:22 +02:00

67 lines
1.6 KiB
Java

package de.lusiardi.testprojekt.dto;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement // for jaxb
public class PersonCreateDto {
private String name;
private String email;
/*
* de.lusiardi.testprojekt.dto.TestDto does not have a no-arg default
* constructor. this problem is related to the following location:
* at de.lusiardi.testprojekt.dto.TestDto
*/
public PersonCreateDto() {
}
public PersonCreateDto(String name, String email) {
this.name = name;
this.email = email;
}
public String getName() {
return name;
}
public void setName(String foo) {
this.name = foo;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public int hashCode() {
int hash = 3;
hash = 37 * hash + (this.name != null ? this.name.hashCode() : 0);
hash = 37 * hash + (this.email != null ? this.email.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final PersonCreateDto other = (PersonCreateDto) obj;
if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
return false;
}
if ((this.email == null) ? (other.email != null) : !this.email.equals(other.email)) {
return false;
}
return true;
}
}