Scala passing class type as an argument
<p>Hey I'm trying to write below code in best possible way in scala, please help me if there is a better way!</p>

<pre><code>public final &lt;T&gt; T deserialize(String jsonString, Class&lt;T&gt; klass) {
    try {
        return objectMapper.readValue(jsonString, klass);
    } catch (Exception e) {
        LOG.error("Failed to deserialize {} to class {}, {}", jsonString, klass, e);
    }
    return null;
}
</code></pre>

<p>Is below a good one?</p>

<pre><code>  def deserialize[T: Manifest](value: String): T = {
    mapper.readValue(value, typeReference[T])
  }
</code></pre>