com.jn.easyjson.tests.examples.struct.Person Maven / Gradle / Ivy
/*
* Copyright 2019 the original author or authors.
*
* Licensed under the LGPL, Version 3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.gnu.org/licenses/lgpl-3.0.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.jn.easyjson.tests.examples.struct;
import java.util.Date;
public class Person {
private int id;
private String name;
private Date birthday;
private Contact contact;
private Gender gender;
private long authCode;
private boolean married;
public boolean isMarried() {
return married;
}
public void setMarried(boolean married) {
this.married = married;
}
public long getAuthCode() {
return authCode;
}
public void setAuthCode(long authCode) {
this.authCode = authCode;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public Contact getContact() {
return contact;
}
public void setContact(Contact contact) {
this.contact = contact;
}
public Gender getGender() {
return gender;
}
public void setGender(Gender gender) {
this.gender = gender;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Person person = (Person) o;
if (id != person.id) return false;
if (!name.equals(person.name)) return false;
if (!birthday.equals(person.birthday)) return false;
if (!gender.equals(person.gender)) return false;
if (authCode != person.authCode) {
return false;
}
return contact.equals(person.contact);
}
@Override
public int hashCode() {
int result = id;
result = 31 * result + name.hashCode();
result = 31 * result + birthday.hashCode();
result = 31 * result + contact.hashCode();
return result;
}
}