title: Get each field as an option of an optional object
body: <p>I have a case class looks like this</p>
  
  <pre><code>case class EmotionData(
        fearful: Double,
        angry: Double,
        sad: Double,
        neutral: Double,
        disgusted: Double,
        surprised: Double,
        happy: Double
      )
  </code></pre>
  
  <p>I receive an <code>Option[EmotionData]</code> and I need each emotion data as an Option[Double].</p>
  
  <p>What I did was: </p>
  
  <pre><code>val (fearful, angry, sad, neutral, disgusted, surprised, happy) = videoResult.emotion match {
          case Some(e) =&gt; (Some(e.fearful), Some(e.angry), Some(e.sad), Some(e.neutral), Some(e.disgusted), Some(e.surprised), Some(e.happy))
          case None =&gt; (None, None, None, None, None, None, None)
        }
  </code></pre>
  
  <p>This way I have each field as an Option[Double] value. </p>
  
  <p>But isn't there a way to do this in Scala where I can iterate through all fields of an object and extract them without rewriting each field?</p>