title: Scala convert Option to an Int
body: <p>I have looked at these links</p>
  
  <p><a href="http://blog.danielwellman.com/2008/03/using-scalas-op.html" rel="noreferrer">http://blog.danielwellman.com/2008/03/using-scalas-op.html</a></p>
  
  <p><a href="http://blog.tmorris.net/scalaoption-cheat-sheet/" rel="noreferrer">http://blog.tmorris.net/scalaoption-cheat-sheet/</a></p>
  
  <p>I have a map of [String, Integer] and when I do a map.get("X") I get an option. I would like the following.</p>
  
  <pre><code>val Int count = map.get(key); 
  // If the key is there I would like value if it is not I want 0
  </code></pre>
  
  <p>How do I achieve this in one line? I need to do this several times. It looks a bit inefficient to write a function everytime for doing this. I am sure there is some intelligent one line quirk that I am missing but I really like to get the value into an integer in ONE line :)</p>