title: Which is the more desirable way to convert Object to Long in Java?
body: <p>I'm dealing with an API that returns <code>Object</code> when I ask for a property.</p>
  
  <pre><code>Object x = r.getProperty("id");
  </code></pre>
  
  <p>But I know for a fact that this property in particular is a <code>Long</code>. So these are the two options I'm weighing:</p>
  
  <pre><code>Long x = Long.parseLong(r.getProperty("id").toString());
  
  Long x = (Long)r.getProperty("id");
  </code></pre>
  
  <p>Which one is preferred performance-wise?</p>