Yuvraj Waghray
import java.util.Objects;
public class Customer {
private String firstName;
private String lastName;
private String email;
private String company;
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 getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getCompany() {
if (company != null) {
return company;
}
return "";
}
public void setCompany(String company) {
this.company = company;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Customer customer = (Customer) o;
return Objects.equals(email, customer.email);
}
@Override
public int hashCode() {
return Objects.hash(email);
}
}
JVM
Android
Browser
Native