Skip to content
Buy me a coffee

SimpleEntry

Defined in: src/abstract/AbstractMap.ts:408

A mutable key/value pair (setValue works), handy for building a custom map’s entry set. Equality and hash follow the map-entry contract, so it equals any entry with an equal key and value; toString() gives key=value.

K

V

new SimpleEntry<K, V>(entry): SimpleEntry<K, V>

Defined in: src/abstract/AbstractMap.ts:412

Creates an entry with the key and value of entry.

MapEntry<K, V>

SimpleEntry<K, V>

new SimpleEntry<K, V>(key, value): SimpleEntry<K, V>

Defined in: src/abstract/AbstractMap.ts:414

Creates an entry mapping key to value; both may be null.

K

V

SimpleEntry<K, V>

[INSPECT](): string

Defined in: src/abstract/AbstractMap.ts:443

Node’s util.inspect hook: console.log prints the toString() form.

string


equals(o): boolean

Defined in: src/abstract/AbstractMap.ts:435

Returns true if o is a map entry with an equal key and an equal value.

unknown

boolean

MapEntry.equals


getKey(): K

Defined in: src/abstract/AbstractMap.ts:421

Returns the key.

K

MapEntry.getKey


getValue(): V

Defined in: src/abstract/AbstractMap.ts:425

Returns the value.

V

MapEntry.getValue


hashCode(): number

Defined in: src/abstract/AbstractMap.ts:439

Returns hashCode(key) ^ hashCode(value).

number

MapEntry.hashCode


setValue(value): V

Defined in: src/abstract/AbstractMap.ts:429

Replaces the value and returns the old one.

V

V

MapEntry.setValue


toString(): string

Defined in: src/abstract/AbstractMap.ts:447

Returns key=value.

string

MapEntry.toString