看看这个类的声明:
public abstract class AbstractTargetBuilder<T extends AbstractTargetBuilder<T, S>, S extends Target> {
...
}
类型T
被定义为AbstractTargetBuilder<T,S>
的子类型。这种模式有什么用?
此代码属于Spotlight
库:
https://github.com/TakuSemba/Spotlight/blob/master/spotlight/src/main/java/com/takusemba/spotlight/target/AbstractTargetBuilder.java