A TypedMap is an immutable map containing typed values. Each entry is associated with a TypedKey that can be used to look up the value. A TypedKey also defines the type of the value, e.g. a TypedKey[String] would be associated with a String value.
Instances of this class are created with the TypedMap.empty method.
The elements inside TypedMaps cannot be enumerated. This is a decision designed to enforce modularity. It's not possible to accidentally or intentionally access a value in a TypedMap without holding the corresponding TypedKey.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
Members list
Value members
Abstract methods
Get a value from the map, throwing an exception if it is not present.
Get a value from the map, throwing an exception if it is not present.
Type parameters
- A
-
The type of value to retrieve.
Value parameters
- key
-
The key for the value to retrieve.
Attributes
- Returns
-
The value, if it is present in the map.
- Throws
-
scala.NoSuchElementException
If the value isn't present in the map.
Check if the map contains a value with the given key.
Check if the map contains a value with the given key.
Value parameters
- key
-
The key to check for.
Attributes
- Returns
-
True if the value is present, false otherwise.
Get a value from the map, returning None if it is not present.
Get a value from the map, returning None if it is not present.
Type parameters
- A
-
The type of value to retrieve.
Value parameters
- key
-
The key for the value to retrieve.
Attributes
- Returns
-
Somevalue, if it is present in the map, otherwiseNone.
Removes a key from the map, returning a new instance of the map.
Removes a key from the map, returning a new instance of the map.
Value parameters
- e1
-
The key to remove.
Attributes
- Returns
-
A new instance of the map with the entry removed.
Removes two keys from the map, returning a new instance of the map.
Removes two keys from the map, returning a new instance of the map.
Value parameters
- e1
-
The first key to remove.
- e2
-
The second key to remove.
Attributes
- Returns
-
A new instance of the map with the entries removed.
Removes three keys from the map, returning a new instance of the map.
Removes three keys from the map, returning a new instance of the map.
Value parameters
- e1
-
The first key to remove.
- e2
-
The second key to remove.
- e3
-
The third key to remove.
Attributes
- Returns
-
A new instance of the map with the entries removed.
Removes keys from the map, returning a new instance of the map.
Removes keys from the map, returning a new instance of the map.
Value parameters
- keys
-
The keys to remove.
Attributes
- Returns
-
A new instance of the map with the entries removed.
Update the map with the given key and value, returning a new instance of the map.
Update the map with the given key and value, returning a new instance of the map.
Type parameters
- A
-
The type of value.
Value parameters
- key
-
The key to set.
- value
-
The value to use.
Attributes
- Returns
-
A new instance of the map with the new entry added.
Update the map with one entry, returning a new instance of the map.
Update the map with one entry, returning a new instance of the map.
Value parameters
- e1
-
The new entry to add to the map.
Attributes
- Returns
-
A new instance of the map with the new entry added.
Update the map with two entries, returning a new instance of the map.
Update the map with two entries, returning a new instance of the map.
Value parameters
- e1
-
The first new entry to add to the map.
- e2
-
The second new entry to add to the map.
Attributes
- Returns
-
A new instance of the map with the new entries added.
Update the map with three entries, returning a new instance of the map.
Update the map with three entries, returning a new instance of the map.
Value parameters
- e1
-
The first new entry to add to the map.
- e2
-
The second new entry to add to the map.
- e3
-
The third new entry to add to the map.
Attributes
- Returns
-
A new instance of the map with the new entries added.
Update the map with several entries, returning a new instance of the map.
Update the map with several entries, returning a new instance of the map.
Value parameters
- entries
-
The new entries to add to the map.
Attributes
- Returns
-
A new instance of the map with the new entries added.
Concrete methods
Attributes
- Returns
-
The Java version for this map.
Deprecated methods
Update the map with several entries, returning a new instance of the map.
Update the map with several entries, returning a new instance of the map.
Value parameters
- entries
-
The new entries to add to the map.
Attributes
- Returns
-
A new instance of the map with the new entries added.
- Deprecated
-
[Since version 2.9.0]Use `updated` instead.
Removes keys from the map, returning a new instance of the map.
Removes keys from the map, returning a new instance of the map.
Value parameters
- keys
-
The keys to remove.
Attributes
- Returns
-
A new instance of the map with the entries removed.
- Deprecated
-
[Since version 2.9.0]Use `removed` instead.