android - Java wildcard is interface -
i have following method:
protected <t> t casttointerface(class<t> tclass, context parent) { try { return tclass.cast(parent); } catch (classcastexception e) { throw new classcastexception(string.valueof(parent) + " must implement " + tclass.getsimplename()); } }
wile method it's job, curious, possible equivalent of
protected <t extends interface> t casttointerface(...
so method accepts classes interfaces?
Comments
Post a Comment