From 28fbf0859c63b2a30555b3295fe738c263c0db6b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 10 Jul 2015 21:45:41 -0400 Subject: lazy: Fix LazyBinder de-duplication. --- .../java/com/tavianator/sangria/lazy/LazyBinder.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sangria-lazy/src/main/java/com/tavianator/sangria') 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(); + } } } -- cgit v1.2.3