象对静态方法和类所做的那样,只要防止程序员在静态字段中引用泛型类型,情况就会好很多。
It would be much better to simply prevent the programmer from referring to generic types in static fields, as is done in the case of static methods and classes.
如果一个类或方法同时提供泛型和非泛型实现,总是选择使用泛型实现。
If a class or a method offers both generic and non generic flavors, always prefer using the generics flavor.
一个静态的泛型和非泛型类工厂方法?
A static factory method on a generic or a non-generic class?
应用推荐