Using Scala, in a Play 2.0 project, I am trying to capture data from a configuration file.
I am currently using the following code to extract a string:
val foo = Play.current.configuration.getString("foo")
I expected to return a String object, but an Option[String] object is returned instead.
I cannot find the Java docs describing the Option[T] object, and calling toString() returns Some( foo ) .
The same thing happens when using configuration methods to extract Boolean and Int values ββfrom a configuration, i.e. Option[Boolean] and Option[Int] returned.
Can someone explain what this Option[T] object is and how can I access the value that I want in the form that calling the application method implies will be returned?
source share