KeyMapping

org.scalatest.enablers.KeyMapping
See theKeyMapping companion trait
object KeyMapping

Companion object for KeyMapping that provides implicit implementations for scala.collection.GenMap and java.util.Map.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
KeyMapping.type

Members list

Implicits

Implicits

implicit def convertEqualityToGenMapKeyMapping[K, V, MAP <: (Map)](equality: Equality[K]): KeyMapping[MAP[K, V]]

Implicit conversion that converts an Equality of type K into KeyMapping of type MAP[K, V], where MAP is a subtype of scala.collection.GenMap. This is required to support the explicit Equality syntax, for example:

Implicit conversion that converts an Equality of type K into KeyMapping of type MAP[K, V], where MAP is a subtype of scala.collection.GenMap. This is required to support the explicit Equality syntax, for example:

(Map("one" -> 1) should contain key "ONE") (after being lowerCased)

(after being lowerCased) will returns an Equality[String] and this implicit conversion will convert it into KeyMapping[Map[String, Int]].

Type parameters

K

the type of the key in the scala.collection.GenMap

MAP

any subtype of scala.collection.GenMap

V

the type of the value in the scala.collection.GenMap

Value parameters

equality

Equality of type K

Attributes

Returns

KeyMapping of type MAP[K, V]

implicit def convertEqualityToJavaMapKeyMapping[K, V, JMAP <: (Map)](equality: Equality[K]): KeyMapping[JMAP[K, V]]

Implicit conversion that converts an Equality of type K into KeyMapping of type JMAP[K, V], where JMAP is a subtype of java.util.Map. This is required to support the explicit Equality syntax, for example:

Implicit conversion that converts an Equality of type K into KeyMapping of type JMAP[K, V], where JMAP is a subtype of java.util.Map. This is required to support the explicit Equality 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 an Equality[String] and this implicit conversion will convert it into KeyMapping[java.util.HashMap[String, Int]].

Type parameters

JMAP

any subtype of java.util.Map

K

the type of the key in the java.util.Map

V

the type of the value in the java.util.Map

Value parameters

equality

Equality of type K

Attributes

Returns

KeyMapping of type JMAP[K, V]

implicit def keyMappingNatureOfGenMap[K, V, MAP <: (Map)](implicit equality: Equality[K]): KeyMapping[MAP[K, V]]

Enable KeyMapping implementation for scala.collection.GenMap.

Enable KeyMapping implementation for scala.collection.GenMap.

Type parameters

K

the type of the key in the scala.collection.GenMap

MAP

any subtype of scala.collection.GenMap

V

the type of the value in the scala.collection.GenMap

Value parameters

equality

Equality type class that is used to check equality of key in the scala.collection.GenMap

Attributes

Returns

KeyMapping[MAP[K, V]] that supports scala.collection.GenMap in contain key syntax

implicit def keyMappingNatureOfJavaMap[K, V, JMAP <: (Map)](implicit equality: Equality[K]): KeyMapping[JMAP[K, V]]

Enable KeyMapping implementation for java.util.Map.

Enable KeyMapping implementation for java.util.Map.

Type parameters

JMAP

any subtype of java.util.Map

K

the type of the key in the java.util.Map

V

the type of the value in the java.util.Map

Value parameters

equality

Equality type class that is used to check equality of key in the java.util.Map

Attributes

Returns

KeyMapping[JMAP[K, V]] that supports java.util.Map in contain key syntax