A pair containing a key and an associated value called the item. Used primarily to represent the elements of a Map. The type Entry<Key,Item> may be abbreviated Key->Item. An instance of Entry may be constructed using the -> operator:

String->Person entry = person.name->person;
By: Gavin
Entry(Key key, Item item)
  • key

    The key used to access the entry.

  • item

    The value associated with the key.

shared actual Integer hash

The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that if x==y then x.hash==y.hash.

Refined declaration: hash
itemSource Code
shared Item item

The value associated with the key.

keySource Code
shared Key key

The key used to access the entry.

pairSource Code

A pair (2 element tuple) with the key and item of this entry.

stringSource Code
shared actual String string

Returns a description of the entry in the form key->item.

Refined declaration: string
equalsSource Code
shared actual Boolean equals(Object that)

Determines if this entry is equal to the given entry. Two entries are equal if they have the same key and the same value.

Refined declaration: equals