[Solved] How can I access a method which return Option object?


The most iconic way ot do it is to unwrap values with scala is to use pattern matching to unwrap the value.

entities match {
    case Some(queryEntities: QueryEntities) => 
      queryEntities.entities.foreach { case e =>
        println(e.columnFamily)
        println(e.fromDate.getOrElse("defaultFromDateHere")
        println(e.toDate.getOrElse("defaultToDateHere"))
      }
    case None => println("No value")
}

9

solved How can I access a method which return Option object?