DeepMapAsJavaMap

com.daodecode.scalaj.collection.package$.DeepMapAsJavaMap
final implicit class DeepMapAsJavaMap[A, B](val scalaMap: Map[A, B]) extends AnyVal

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def deepAsJava[C, D](implicit keyConverter: JConverter[A, C], valueConverter: JConverter[B, D]): Map[C, D]

Converts given Scala scala.collection.Map to Java JMap. Keys and values inside map are converted using given implicit converters, which allow to convert nested Scala collections and primitives. If given map is mutable, then returned Java map is mutable as well.

Converts given Scala scala.collection.Map to Java JMap. Keys and values inside map are converted using given implicit converters, which allow to convert nested Scala collections and primitives. If given map is mutable, then returned Java map is mutable as well.

Type parameters

C

New type of Java map key

D

New type of Java map value

Value parameters

keyConverter

Implicit converter to convert from A to C

valueConverter

Implicit converter to convert from B to D

Attributes

Returns

Java map wrapper around given map if given map keys and values are primitives or anything but supported Scala collections. Wrapper around new map otherwise. Example:

          scala> val m = Map(3L -> Set('3'))
          m: scala.collection.immutable.Map[Long,scala.collection.immutable.Set[Char]] = Map(3 -> Set(3))
          scala> m.deepAsJava
          res0: com.daodecode.scalaj.collection.package.JMap[com.daodecode.scalaj.collection.JLong,com.daodecode.scalaj.collection.JSet[com.daodecode.scalaj.collection.JChar]] = {3=[3]}

Concrete fields

val scalaMap: Map[A, B]