1 22 23 24 package com.mchange.v1.util; 25 26 import java.util.Map ; 27 import com.mchange.v2.lang.ObjectUtils; 28 29 public abstract class AbstractMapEntry implements Map.Entry 30 { 31 public abstract Object getKey(); 32 33 public abstract Object getValue(); 34 35 public abstract Object setValue(Object value); 36 37 public boolean equals(Object o) 38 { 39 if (o instanceof Map.Entry ) 40 { 41 Map.Entry other = (Map.Entry ) o; 42 return 43 ObjectUtils.eqOrBothNull( this.getKey(), other.getKey() ) && 44 ObjectUtils.eqOrBothNull( this.getValue(), other.getValue() ); 45 } 46 else 47 return false; 48 } 49 50 public int hashCode() 51 { 52 return 53 (this.getKey() == null ? 0 : this.getKey().hashCode()) ^ 54 (this.getValue() == null ? 0 : this.getValue().hashCode()); 55 } 56 } 57 | Popular Tags |