title: how to convert value got from map to int in scala
body: <pre><code>private def getInterfaceInfo(rawData: JsValue): NetworkDeviceInterfaceInfo = {
    def getTotalInterfaces(group1: JsValue): Int = {
      var count: Int = 0
      val interfacesList = group1.as[JsObject].fields.groupBy {
        case (key, value) =&gt; key.split("_", 2)(1)
      }.map {
        case (key, values) =&gt;
          (key, values.toMap)
      }.map {
        case (key, valuesMap) =&gt;
          val ifType = valuesMap.get(s"ifType_$key").getOrElse()
          if (ifType.toString.contains("6")) {
            count += 1
          }
      }
      return count
    }
  </code></pre>
  
  <p>//Here in code val ifType i got its value "2" i want it like 2 ...can anybody help me out from here</p>