I have to cast primitive double to Long ( Wrapper) at multiple locations in my code. These are 2 ways I could work with -
linkcatch.setCode(Long.valueOf((long) relatedCd.getDouble(value)));
( casting primitive double to primitive long and then Wrapper Long)
linkcatch.setCode(Long.valueOf(String.valueOf(relatedCd.getDouble(value))));
( casting double to String to Wrapper Long )
Is there any way to cast from native double to Wrapper long without doing the intermediate casting.
I am concerned because there are numerous locations where i need to do this. Thanks.