object KeyMapping
Companion object for KeyMapping
that provides implicit implementations for scala.collection.GenMap
and java.util.Map
.
- Source
- KeyMapping.scala
- Alphabetic
- By Inheritance
- KeyMapping
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
implicit
def
convertEqualityToGenMapKeyMapping[K, V, MAP[k, v] <: GenMap[k, v]](equality: Equality[K]): KeyMapping[MAP[K, V]]
Implicit conversion that converts an
Equality
of typeK
intoKeyMapping
of typeMAP[K, V]
, whereMAP
is a subtype ofscala.collection.GenMap
.Implicit conversion that converts an
Equality
of typeK
intoKeyMapping
of typeMAP[K, V]
, whereMAP
is a subtype ofscala.collection.GenMap
. This is required to support the explicitEquality
syntax, for example:(Map("one" -> 1) should contain key "ONE") (after being lowerCased)
(after being lowerCased)
will returns anEquality[String]
and this implicit conversion will convert it intoKeyMapping[Map[String, Int]]
.- K
the type of the key in the
scala.collection.GenMap
- V
the type of the value in the
scala.collection.GenMap
- MAP
any subtype of
scala.collection.GenMap
- equality
Equality
of typeK
- returns
KeyMapping
of typeMAP[K, V]
-
implicit
def
convertEqualityToJavaMapKeyMapping[K, V, JMAP[k, v] <: Map[k, v]](equality: Equality[K]): KeyMapping[JMAP[K, V]]
Implicit conversion that converts an
Equality
of typeK
intoKeyMapping
of typeJMAP[K, V]
, whereJMAP
is a subtype ofjava.util.Map
.Implicit conversion that converts an
Equality
of typeK
intoKeyMapping
of typeJMAP[K, V]
, whereJMAP
is a subtype ofjava.util.Map
. This is required to support the explicitEquality
syntax, for example:val javaMap = new java.util.HashMap[String, Int]() javaMap.put("one", 1) (javaMap should contain key "ONE") (after being lowerCased)
(after being lowerCased)
will returns anEquality[String]
and this implicit conversion will convert it intoKeyMapping[java.util.HashMap[String, Int]]
.- K
the type of the key in the
java.util.Map
- V
the type of the value in the
java.util.Map
- JMAP
any subtype of
java.util.Map
- equality
Equality
of typeK
- returns
KeyMapping
of typeJMAP[K, V]
-
implicit
def
keyMappingNatureOfGenMap[K, V, MAP[k, v] <: GenMap[k, v]](implicit equality: Equality[K]): KeyMapping[MAP[K, V]]
Enable
KeyMapping
implementation forscala.collection.GenMap
.Enable
KeyMapping
implementation forscala.collection.GenMap
.- K
the type of the key in the
scala.collection.GenMap
- V
the type of the value in the
scala.collection.GenMap
- MAP
any subtype of
scala.collection.GenMap
- equality
Equality
type class that is used to check equality of key in thescala.collection.GenMap
- returns
KeyMapping[MAP[K, V]]
that supportsscala.collection.GenMap
incontain key
syntax
-
implicit
def
keyMappingNatureOfJavaMap[K, V, JMAP[k, v] <: Map[k, v]](implicit equality: Equality[K]): KeyMapping[JMAP[K, V]]
Enable
KeyMapping
implementation forjava.util.Map
.Enable
KeyMapping
implementation forjava.util.Map
.- K
the type of the key in the
java.util.Map
- V
the type of the value in the
java.util.Map
- JMAP
any subtype of
java.util.Map
- equality
Equality
type class that is used to check equality of key in thejava.util.Map
- returns
KeyMapping[JMAP[K, V]]
that supportsjava.util.Map
incontain
key
syntax