KeyValuePair

从今天开始记录一些比较好的代码,以备后用

public final class KeyValuePair <K, V> { public KeyValuePair(K key, V value) { this.key = key; this.value = value; } private K key; public void setKey(K key) { this.key = key; } public K getKey() { return key; } private V value; public void setValue(V value) { this.value = value; } public V getValue() { return value; } public boolean equals(KeyValuePair<K, V> pair) { return pair.getKey() == this.key && pair.getValue() == this.value; } }

 

 

你可能感兴趣的:(KeyValuePair)