DeepJavaSetAsMutableSet

com.daodecode.scalaj.collection.package$.DeepJavaSetAsMutableSet
final implicit class DeepJavaSetAsMutableSet[A](val javaSet: Set[A]) extends AnyVal

Attributes

Graph
Supertypes
class AnyVal
trait Matchable
class Any

Members list

Value members

Concrete methods

def deepAsScala[B](implicit converter: SConverter[A, B]): Set[B]

Converts given Java JSet to mutable Scala scala.collection.mutable.Set Elements inside set are converted using given implicit converter, which allows to convert nested Java collections and primitives.

Converts given Java JSet to mutable Scala scala.collection.mutable.Set Elements inside set are converted using given implicit converter, which allows to convert nested Java collections and primitives.

Type parameters

B

New type of resulting Set elements

Value parameters

converter

Implicit converter to convert from A to B.

Attributes

Returns

Scala wrapper around given Java set if given set elements are primitives or anything but supported Java collections. Wrapper around new set otherwise. Example:

          scala> val js = new java.util.HashSet[java.util.Set[JInt]]()
          js: java.util.HashSet[java.util.Set[com.daodecode.scalaj.collection.JInt]] = []
          scala> js.add(new java.util.HashSet[JInt])
          res0: Boolean = true
          scala> js.iterator.next.add(34)
          res1: Boolean = true
          scala> js
          res2: java.util.HashSet[java.util.Set[com.daodecode.scalaj.collection.JInt]] = [[34]]
          scala> js.deepAsScala
          res3: scala.collection.mutable.Set[scala.collection.mutable.Set[Int]] = Set(Set(34))

Concrete fields

val javaSet: Set[A]