Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + ((codigo == null) ? 0 : codigo.hashCode());
- result = prime * result + ((tamanho == null) ? 0 : tamanho.hashCode());
- return result;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- ProdutoComTamanho other = (ProdutoComTamanho) obj;
- if (codigo == null) {
- if (other.codigo != null)
- return false;
- } else
- return false;
- if (tamanho == null) {
- if (other.tamanho != null)
- return false;
- } else if (!tamanho.equals(other.tamanho) && !codigo.equals(other.codigo))
- return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement