Packages

o

scala.jdk.javaapi

OptionConverters

object OptionConverters

This object contains methods that convert between Scala Option and Java Optional types.

The explicit conversion methods defined here are intended to be used in Java code. For Scala code, it is recommended to use the extension methods defined in scala.jdk.OptionConverters.

Source
OptionConverters.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OptionConverters
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def toJava[A](o: Option[A]): Optional[A]

    Convert a Scala Option to a Java Optional

  2. def toJavaOptionalDouble(o: Option[java.lang.Double]): OptionalDouble

    Convert a Scala Option[java.lang.Double] to a Java OptionalDouble

    Convert a Scala Option[java.lang.Double] to a Java OptionalDouble

    Note: this method uses the boxed type java.lang.X instead of the primitive type scala.X to improve compatibility when using it in Java code (the Scala compiler emits C[Int] as C[Object] in bytecode due to scala/bug#4214). In Scala code, add import scala.jdk.OptionConverters._ and use the extension methods instead.

  3. def toJavaOptionalInt(o: Option[Integer]): OptionalInt

    Convert a Scala Option[java.lang.Integer] to a Java OptionalInt

    Convert a Scala Option[java.lang.Integer] to a Java OptionalInt

    Note: this method uses the boxed type java.lang.X instead of the primitive type scala.X to improve compatibility when using it in Java code (the Scala compiler emits C[Int] as C[Object] in bytecode due to scala/bug#4214). In Scala code, add import scala.jdk.OptionConverters._ and use the extension methods instead.

  4. def toJavaOptionalLong(o: Option[java.lang.Long]): OptionalLong

    Convert a Scala Option[java.lang.Long] to a Java OptionalLong

    Convert a Scala Option[java.lang.Long] to a Java OptionalLong

    Note: this method uses the boxed type java.lang.X instead of the primitive type scala.X to improve compatibility when using it in Java code (the Scala compiler emits C[Int] as C[Object] in bytecode due to scala/bug#4214). In Scala code, add import scala.jdk.OptionConverters._ and use the extension methods instead.

  5. def toScala(o: OptionalLong): Option[java.lang.Long]

    Convert a Java OptionalLong to a Scala Option[java.lang.Long]

    Convert a Java OptionalLong to a Scala Option[java.lang.Long]

    Note: this method uses the boxed type java.lang.X instead of the primitive type scala.X to improve compatibility when using it in Java code (the Scala compiler emits C[Int] as C[Object] in bytecode due to scala/bug#4214). In Scala code, add import scala.jdk.OptionConverters._ and use the extension methods instead.

  6. def toScala(o: OptionalInt): Option[Integer]

    Convert a Java OptionalInt to a Scala Option[java.lang.Integer]

    Convert a Java OptionalInt to a Scala Option[java.lang.Integer]

    Note: this method uses the boxed type java.lang.X instead of the primitive type scala.X to improve compatibility when using it in Java code (the Scala compiler emits C[Int] as C[Object] in bytecode due to scala/bug#4214). In Scala code, add import scala.jdk.OptionConverters._ and use the extension methods instead.

  7. def toScala(o: OptionalDouble): Option[java.lang.Double]

    Convert a Java OptionalDouble to a Scala Option[java.lang.Double]

    Convert a Java OptionalDouble to a Scala Option[java.lang.Double]

    Note: this method uses the boxed type java.lang.X instead of the primitive type scala.X to improve compatibility when using it in Java code (the Scala compiler emits C[Int] as C[Object] in bytecode due to scala/bug#4214). In Scala code, add import scala.jdk.OptionConverters._ and use the extension methods instead.

  8. def toScala[A](o: Optional[A]): Option[A]

    Convert a Java Optional to a Scala Option