Skip to content

Instantly share code, notes, and snippets.

@SeungUkLee
Created March 10, 2018 14:44
Show Gist options
  • Save SeungUkLee/d05247f73f03a27bfb235907fb6c8846 to your computer and use it in GitHub Desktop.
Save SeungUkLee/d05247f73f03a27bfb235907fb6c8846 to your computer and use it in GitHub Desktop.
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Product)) return false;
Product that = (Product) o;
//that 이 proxyObject 일 수도 있으므로 getter 로 들고온다.
return Objects.equals(this.id, that.getId()) &&
Objects.equals(this.name, that.getName()) &&
Objects.equals(this.price, that.getPrice());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment