| /* |
| * Copyright (c) 2014, 2020 Oracle and/or its affiliates. All rights reserved. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0, |
| * or the Eclipse Distribution License v. 1.0 which is available at |
| * http://www.eclipse.org/org/documents/edl-v10.php. |
| * |
| * SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause |
| */ |
| |
| // Contributors: |
| // Martin Vojtek - 2.6.0 - initial implementation |
| package org.eclipse.persistence.testing.perf.json.model; |
| |
| import java.util.ArrayList; |
| import java.util.List; |
| |
| public class Employee { |
| |
| private String firstName; |
| private String lastName; |
| private int id; |
| private List<PhoneNumber> phoneNumbers = new ArrayList<PhoneNumber>(); |
| |
| 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 int getId() { |
| return id; |
| } |
| |
| public void setId(int id) { |
| this.id = id; |
| } |
| |
| public List<PhoneNumber> getPhoneNumbers() { |
| return phoneNumbers; |
| } |
| |
| public void setPhoneNumbers(List<PhoneNumber> phoneNumbers) { |
| this.phoneNumbers = phoneNumbers; |
| } |
| |
| @Override |
| public int hashCode() { |
| final int prime = 31; |
| int result = 1; |
| result = prime * result + ((firstName == null) ? 0 : firstName.hashCode()); |
| result = prime * result + id; |
| result = prime * result + ((lastName == null) ? 0 : lastName.hashCode()); |
| result = prime * result + ((phoneNumbers == null) ? 0 : phoneNumbers.hashCode()); |
| return result; |
| } |
| |
| @Override |
| public boolean equals(Object obj) { |
| if (this == obj) |
| return true; |
| if (obj == null) |
| return false; |
| if (getClass() != obj.getClass()) |
| return false; |
| Employee other = (Employee) obj; |
| if (firstName == null) { |
| if (other.firstName != null) |
| return false; |
| } else if (!firstName.equals(other.firstName)) |
| return false; |
| if (id != other.id) |
| return false; |
| if (lastName == null) { |
| if (other.lastName != null) |
| return false; |
| } else if (!lastName.equals(other.lastName)) |
| return false; |
| if (phoneNumbers == null) { |
| if (other.phoneNumbers != null) |
| return false; |
| } else if (!phoneNumbers.equals(other.phoneNumbers)) |
| return false; |
| return true; |
| } |
| |
| @Override |
| public String toString() { |
| return "Employee [firstName=" + firstName + ", lastName=" + lastName + ", id=" + id + ", phoneNumbers=" + phoneNumbers + "]"; |
| } |
| |
| } |