Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public class Pair<K, V> {
  2. private K key;
  3. private V value;
  4.  
  5. public Pair(K key, V value) {
  6. this.key = key;
  7. this.value = value;
  8. }
  9.  
  10. public void setKey(K key) { this.key = key; }
  11. public void setValue(V value) { this.value = value; }
  12. public K getKey() { return key; }
  13. public V getValue() { return value; }
  14. }
  15.  
  16. public class Util {
  17. public static <K, V> boolean compare(Pair<K, V> p1, Pair<K, V> p2) {
  18. return p1.getKey().equals(p2.getKey()) &&
  19. p1.getValue().equals(p2.getValue());
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement