title: Using Option with .map() and .getOrElse()
body: <p>I am trying to read a value from a <code>Map[String, String]</code> given a key.
  This key|value is optional, in that it might not be there
  So, I want to use Option and then <code>map</code> &amp; <code>getOrElse</code> as below to write the value if it's there, or set it to some default in case it's not there. </p>
  
  <pre><code>val endpoint:String = Option(config.getString("endpoint"))
      .map(_.value())
      .getOrElse()
  </code></pre>
  
  <p>The code above fails with "Symbol value is inaccessible from this place"</p>
  
  <p>config is a <code>Map[String, Object]</code></p>
  
  <p><code>getString</code> is a method on config that takes in the key, and returns the value</p>
  
  <pre><code>public String getString(String key){
      &lt;...returns value...&gt;
  }
  </code></pre>
  
  <p>I could just drop the Option() and do, but then I have to deal with the exception that will be throw by getString()</p>
  
  <pre><code>val endpoint:String = config.getString("endpoint")
  </code></pre>
  
  <p>Any ideas what's wrong with this, or how to fix this? 
  Better ways of writing this? </p>
  
  <p>UPDATE: I need to mention that config is an object in an imported Java library. Not sure if that makes a difference or not. </p>