I am new to Scala and searched for the same as to how can we change from Option[String]
to a Map[String,trait]
but could not find much .
The thing is I have a field of type Option[String]
and I have to pass that value to a case class which takes input as a Map[String,User Defined trait]
.
That's what I want to know as to how can I convert the value of Option[String]
to Map[]
Can we use Option.fold
in this?
Could you please guide me further on this.
TIA