1 16 package org.apache.commons.collections.keyvalue; 17 18 import java.util.Map ; 19 20 import org.apache.commons.collections.KeyValue; 21 22 31 public abstract class AbstractMapEntryDecorator implements Map.Entry , KeyValue { 32 33 34 protected final Map.Entry entry; 35 36 42 public AbstractMapEntryDecorator(Map.Entry entry) { 43 if (entry == null) { 44 throw new IllegalArgumentException ("Map Entry must not be null"); 45 } 46 this.entry = entry; 47 } 48 49 54 protected Map.Entry getMapEntry() { 55 return entry; 56 } 57 58 public Object getKey() { 60 return entry.getKey(); 61 } 62 63 public Object getValue() { 64 return entry.getValue(); 65 } 66 67 public Object setValue(Object object) { 68 return entry.setValue(object); 69 } 70 71 public boolean equals(Object object) { 72 if (object == this) { 73 return true; 74 } 75 return entry.equals(object); 76 } 77 78 public int hashCode() { 79 return entry.hashCode(); 80 } 81 82 public String toString() { 83 return entry.toString(); 84 } 85 86 } 87 | Popular Tags |