MCPcopy Index your code
hub / github.com/davidgiven/luje / MapEntry

Class MapEntry

lib/java/util/MapEntry.java:23–89  ·  view source on GitHub ↗

MapEntry is an internal class which provides an implementation of Map.Entry.

Source from the content-addressed store, hash-verified

21 * MapEntry is an internal class which provides an implementation of Map.Entry.
22 */
23class MapEntry<K, V> implements Map.Entry<K, V>, Cloneable {
24
25 K key;
26 V value;
27
28 interface Type<RT, KT, VT> {
29 RT get(MapEntry<KT, VT> entry);
30 }
31
32 MapEntry(K theKey) {
33 key = theKey;
34 }
35
36 MapEntry(K theKey, V theValue) {
37 key = theKey;
38 value = theValue;
39 }
40
41 @Override
42 public Object clone() {
43 try {
44 return super.clone();
45 } catch (CloneNotSupportedException e) {
46 return null;
47 }
48 }
49
50 @Override
51 public boolean equals(Object object) {
52 if (this == object) {
53 return true;
54 }
55 if (object instanceof Map.Entry) {
56 Map.Entry<?, ?> entry = (Map.Entry<?, ?>) object;
57 return (key == null ? entry.getKey() == null : key.equals(entry
58 .getKey()))
59 && (value == null ? entry.getValue() == null : value
60 .equals(entry.getValue()));
61 }
62 return false;
63 }
64
65 public K getKey() {
66 return key;
67 }
68
69 public V getValue() {
70 return value;
71 }
72
73 @Override
74 public int hashCode() {
75 return (key == null ? 0 : key.hashCode())
76 ^ (value == null ? 0 : value.hashCode());
77 }
78
79 public V setValue(V object) {
80 V result = value;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected