We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router.getInstance().getService()返回值能否改成泛型?不然每次都得显式强制类型转换:
Object service = Router.getInstance().getService(...); if (service != null) { IXXXService xxxService = (IXXXService) service; }
改为泛型类型后自动隐式强转:
public synchronized <T> T getService(String serviceName) { if (serviceName == null) { return null; } return (T) services.get(serviceName); }
IXXXService xxxService = Router.getInstance().getService(...); if (service != null) { ... }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Router.getInstance().getService()返回值能否改成泛型?不然每次都得显式强制类型转换:
改为泛型类型后自动隐式强转:
The text was updated successfully, but these errors were encountered: