Is there any way to typecast in Java without using type.parseType()? Specifically, I'm having a great deal of trouble trying to convert a double to an int. I've tried using intValue, but that doesn't seem to work with primitive data types (I get a "cannot be dereferenced" error).