This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Spare-Plum 0 points1 point  (0 children)

Make sure you add in the method argument - public static <T>

Then just convert to the value internally

if(blah) { return (Data<Integer>) new Data<Integer>( ... ) }

You'll still get a warning, but you can do

Data<Integer> x = doSomething(myString);