This might work:
final scala.Option<String> x = scala.Option.apply(null);
def apply [A] (x: A): Option[A]
An Option factory which creates
Some(x) if the argument is not null, and None if it is null.
More Related Contents:
- Using Scala traits with implemented methods in Java
- Iterating over Java collections in Scala
- How can I use a Scala singleton object in Java?
- Using a Java library with Scala reserved words
- How to convert a scala.List to a java.util.List?
- Convert Java Map to Scala Map
- Write Java Program to grade Scala Homeworks
- Why is volatile used in double checked locking
- Double Checked Locking in Singleton
- How to use java.String.format in Scala?
- Using Singleton design pattern for SQLiteDatabase
- Singleton with Arguments in Java
- Scala equivalent of Java java.lang.Class Object
- Why implementing a Singleton pattern in Java code is (sometimes) considered an anti-pattern in Java world?
- Shuffle a list of integers with Java 8 Streams API
- Is asynchronous jdbc call possible?
- Sign CSR using Bouncy Castle
- Java compile speed vs Scala compile speed
- Memory barriers and coding style over a Java VM
- Get value from one Optional or another
- Converting a Java collection into a Scala collection
- What are the Spark transformations that causes a Shuffle?
- Android: Cannot perform this operation because the connection pool has been closed
- Singleton across JVM or Application instance or Tomcat instance
- Implementing the singleton pattern in Java
- How do I disambiguate in Scala between methods with vararg and without
- Spark spark-submit –jars arguments wants comma list, how to declare a directory of jars?
- ‘Optional.get()’ without ‘isPresent()’ check
- How to create a singleton class
- Static references are cleared–does Android unload classes at runtime if unused?