package com.prancingdonkey.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
//<start id="canonical_data_model"/>
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Customer implements Serializable {
String customerId;
String firstName;
String lastName;
Date birthday;
long totalOrders;
BigDecimal totalSpendForYear;
Address address;
//<end id="canonical_data_model"/>
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getCustomerId() {
return customerId;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public long getTotalOrders() {
return totalOrders;
}
public void setTotalOrders(long totalOrders) {
this.totalOrders = totalOrders;
}
public BigDecimal getTotalSpendForYear() {
return totalSpendForYear;
}
public void setTotalSpendForYear(BigDecimal totalSpendForYear) {
this.totalSpendForYear = totalSpendForYear;
}
public Address getAddress() {
return address;
}
public void setAddress(Address address) {
this.address = address;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Customer customer = (Customer) o;
if (firstName != null ? !firstName.equals(customer.firstName)
: customer.firstName != null) return false;
if (lastName != null ? !lastName.equals(customer.lastName)
: customer.lastName != null) return false;
return true;
}
@Override
public int hashCode() {
int result = firstName != null ? firstName.hashCode() : 0;
result = 31 * result + (lastName != null
? lastName.hashCode() : 0);
return result;
}
}