@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + celular; result = prime * result + ((cpf == null) ? 0 : cpf.hashCode()); result = prime * result + id_telefone; result = prime * result + ((observacao == null) ? 0 : observacao.hashCode()); result = prime * result + telefone_comercial; result = prime * result + telefone_residencial; return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Telefone other = (Telefone) obj; if (celular != other.celular) return false; if (cpf == null) { if (other.cpf != null) return false; } else if (!cpf.equals(other.cpf)) return false; if (id_telefone != other.id_telefone) return false; if (observacao == null) { if (other.observacao != null) return false; } else if (!observacao.equals(other.observacao)) return false; if (telefone_comercial != other.telefone_comercial) return false; if (telefone_residencial != other.telefone_residencial) return false; return true; }