watch: add package local class Pair to replace javafx.util.Pair.
@@ -25,7 +25,6 @@ import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import javafx.util.Pair;
/**
* etcd watcher Implementation.
@@ -426,4 +425,37 @@ public class EtcdWatchImpl implements EtcdWatch {
}
}
+ class Pair<K, V> {
+
+ final K key;
+ final V value;
+
+ Pair(K k, V v) {
+ this.key = k;
+ this.value = v;
+ }
+
+ K getKey() {
+ return key;
+ }
+
+ V getValue() {
+ return value;
+ }
+
+ @Override
+ public int hashCode() {
+ return key.hashCode() + value.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null || !(obj instanceof Pair)) {
+ return false;
+ }
+ Pair<K, V> other = (Pair<K, V>) obj;
+ return key.equals(other.key) && value.equals(other.value);
+ }
+ }
+
}
