Class cast exception from Double to double
<p>Why class cast exception from Double to double?</p>

<p>Used like:</p>

<pre><code>Console.writeLine(Validator.TryParse("1.5", double.class));
</code></pre>

<p>Code:</p>

<pre><code>public static &lt;T&gt; T TryParse(Object ConvertFrom, java.lang.Class&lt;T&gt; ConvertTo) {
        switch(ConvertTo.getSimpleName().toLowerCase()) {
            case "int":
            case "integer": return ConvertTo.cast((int)Integer.parseInt((String)ConvertFrom));      
            case "string": return ConvertTo.cast(String.valueOf(ConvertFrom));             
            case "double": return ConvertTo.cast((double)Double.parseDouble((String)ConvertFrom));              
            case "float": return ConvertTo.cast((float)Float.parseFloat((String)ConvertFrom));              
            case "long": return ConvertTo.cast((long)Long.parseLong((String)ConvertFrom));          
            default: return null;
        }
    }
</code></pre>
