// @SuppressWarnings("unchecked")
private <T> T extractResult(Continuation continuation) {
Object result = continuation.getAttribute("result");
return (T) result;
}
Is it (at runtime) possible to verify that result can be cast to T?
No. To check at runtime, you need an instance of a class, so that you can use isAssignableFrom. You don't have access to this using T due to type erasure.
Not within this method. All type information related to T is erased by the compiler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With