Вопрос по list – Scala: список [Tuple3] для сопоставления [String, String]

4

Error: User Rate Limit ExceededList[(Int,String,Double)]Error: User Rate Limit ExceededMap[String,String]Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

val prices = (dao.getPricing flatMap {
  case(id, label, fee) =>
    Map(id.toString -> (label+" $"+fee))
  }).toMap

Error: User Rate Limit Exceeded

Ваш Ответ

2   ответа
9

Error: User Rate Limit Exceeded

val prices: Map[String, String] =
  dao.getPricing.map {
    case (id, label, fee) => (id.toString -> (label + " $" + fee))
  }(collection.breakOut)

Error: User Rate Limit Exceededcollection.breakOutError: User Rate Limit ExceededCanBuildFromError: User Rate Limit ExceededListError: User Rate Limit ExceededMapError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded virtualeyes
Error: User Rate Limit Exceeded virtualeyes
Error: User Rate Limit ExceededbreakOutError: User Rate Limit Exceeded
8

Error: User Rate Limit Exceeded

val prices =
  dao.getPricing.map { case (id, label, fee) => ( id.toString, label+" $"+fee)} toMap

Error: User Rate Limit Exceeded

val prices =
  dao.getPricing.map { p => ( p._1.toString, p._2+" $"+p._3)} toMap
Error: User Rate Limit ExceededlotError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded virtualeyes
Error: User Rate Limit Exceeded virtualeyes
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded virtualeyes

Похожие вопросы