diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2015-07-10 21:45:41 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2015-07-10 21:45:41 -0400 |
commit | 28fbf0859c63b2a30555b3295fe738c263c0db6b (patch) | |
tree | e3b73382eaa62e5ebb12063435e98b2c1eb9029e /sangria-lazy/src/main/java/com | |
parent | 2621acbb9115fe76f8638e4fdc838151353705b4 (diff) | |
download | sangria-28fbf0859c63b2a30555b3295fe738c263c0db6b.tar.xz |
lazy: Fix LazyBinder de-duplication.
Diffstat (limited to 'sangria-lazy/src/main/java/com')
-rw-r--r-- | sangria-lazy/src/main/java/com/tavianator/sangria/lazy/LazyBinder.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sangria-lazy/src/main/java/com/tavianator/sangria/lazy/LazyBinder.java b/sangria-lazy/src/main/java/com/tavianator/sangria/lazy/LazyBinder.java index 26d3848..baad5da 100644 --- a/sangria-lazy/src/main/java/com/tavianator/sangria/lazy/LazyBinder.java +++ b/sangria-lazy/src/main/java/com/tavianator/sangria/lazy/LazyBinder.java @@ -269,5 +269,22 @@ public class LazyBinder { return visitor.visit(binding); } } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } else if (!(obj instanceof LazyProvider)) { + return false; + } + + LazyProvider<?> other = (LazyProvider<?>) obj; + return key.equals(other.key); + } + + @Override + public int hashCode() { + return key.hashCode(); + } } } |