play.libs
Class Scala

java.lang.Object
  extended by play.libs.Scala

public class Scala
extends java.lang.Object

Class that contains useful java <-> scala conversion helpers.


Constructor Summary
Scala()
           
 
Method Summary
static
<K,V> java.util.Map<K,V>
asJava(scala.collection.Map<K,V> scalaMap)
          Converts a Scala Map to Java.
static
<T> java.util.List<T>
asJava(scala.collection.Seq<T> scalaList)
          Converts a Scala List to Java.
static
<A,B> scala.collection.immutable.Map<A,B>
asScala(java.util.Map<A,B> javaMap)
          Converts a Java Map to Scala.
static
<A,B> scala.collection.immutable.Map<A,B>
emptyMap()
          Creates an empty Scala Map.
static
<T> scala.collection.Seq<T>
emptySeq()
          Creates an empty Scala Seq.
static
<T> scala.Option<T>
Option(T t)
          Wrap a value into a Scala Option.
static
<T> T
orNull(scala.Option<T> opt)
          Wrap a Scala Option, handling None as null.
static
<T> scala.collection.Seq<T>
toSeq(java.util.List<T> list)
          Converts a Java List to Scala Seq.
static
<T> scala.collection.Seq<T>
toSeq(T[] array)
          Converts a Java Array to Scala Seq.
static
<A,B> scala.Tuple2<A,B>
Tuple(A a, B b)
          Create a Scala Tuple2.
static
<T> scala.collection.Seq<T>
varargs(T... array)
          Converts a Java varargs to Scala Seq.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scala

public Scala()
Method Detail

orNull

public static <T> T orNull(scala.Option<T> opt)
Wrap a Scala Option, handling None as null.


asJava

public static <K,V> java.util.Map<K,V> asJava(scala.collection.Map<K,V> scalaMap)
Converts a Scala Map to Java.


asScala

public static <A,B> scala.collection.immutable.Map<A,B> asScala(java.util.Map<A,B> javaMap)
Converts a Java Map to Scala.


asJava

public static <T> java.util.List<T> asJava(scala.collection.Seq<T> scalaList)
Converts a Scala List to Java.


toSeq

public static <T> scala.collection.Seq<T> toSeq(java.util.List<T> list)
Converts a Java List to Scala Seq.


toSeq

public static <T> scala.collection.Seq<T> toSeq(T[] array)
Converts a Java Array to Scala Seq.


varargs

public static <T> scala.collection.Seq<T> varargs(T... array)
Converts a Java varargs to Scala Seq.


Option

public static <T> scala.Option<T> Option(T t)
Wrap a value into a Scala Option.


Tuple

public static <A,B> scala.Tuple2<A,B> Tuple(A a,
                                            B b)
Create a Scala Tuple2.


emptySeq

public static <T> scala.collection.Seq<T> emptySeq()
Creates an empty Scala Seq.


emptyMap

public static <A,B> scala.collection.immutable.Map<A,B> emptyMap()
Creates an empty Scala Map.