Skip to content

Updating docs to use CollectionConverters over JavaConverters #1645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ Scala と同様に、Java

このような変換を作動させるには、[JavaConverters](https://www.scala-lang.org/api/{{ site.scala-version }}/scala/collection/JavaConverters$.html) オブジェクトからインポートするだけでいい:

scala> import collection.JavaConverters._
import collection.JavaConverters._
scala> import scala.jdk.CollectionConverters._
import scala.jdk.CollectionConverters._

これで `asScala` 及び `asJava` 拡張メソッドを呼び出すことで Scala コレクションとそれに対応する Java コレクションの変換が行われる。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Sometimes you might need to pass from one collection framework to the other. For

To enable these conversions, simply import them from the [JavaConverters](https://www.scala-lang.org/api/{{ site.scala-version }}/scala/collection/JavaConverters$.html) object:

scala> import collection.JavaConverters._
import collection.JavaConverters._
scala> import scala.jdk.CollectionConverters._
import scala.jdk.CollectionConverters._

This enables conversions between Scala collections and their corresponding Java collections by way of extension methods called `asScala` and `asJava`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Sometimes you might need to pass from one collection framework to the other. For

To enable these conversions, simply import them from the [JavaConverters](https://www.scala-lang.org/api/{{ site.scala-212-version }}/scala/collection/JavaConverters$.html) object:

scala> import collection.JavaConverters._
import collection.JavaConverters._
scala> import scala.jdk.CollectionConverters._
import scala.jdk.CollectionConverters._

This enables conversions between Scala collections and their corresponding Java collections by way of extension methods called `asScala` and `asJava`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ language: ru

Чтобы задействовать эти неявные преобразования, просто импортируйте объект [JavaConverters](https://www.scala-lang.org/api/{{ site.scala-version }}/scala/collection/JavaConverters$.html) :

scala> import collection.JavaConverters._
import collection.JavaConverters._
scala> import scala.jdk.CollectionConverters._
import scala.jdk.CollectionConverters._

Это позволит преобразовывать коллекции Scala в соответствующие коллекции Java с помощью методов расширения, называемых `asScala` и `asJava`:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ language: zh-cn

使用这些转换很简单,只需从JavaConverters对象中import它们即可。

scala> import collection.JavaConverters._
import collection.JavaConverters._
scala> import scala.jdk.CollectionConverters._
import scala.jdk.CollectionConverters._

import之后,通过扩展方法 asScala 和 asJava 就可以在Scala容器和与之对应的Java容器之间进行隐式转换了

Expand Down