Take a look at this class declaration:
public abstract class AbstractTargetBuilder<T extends AbstractTargetBuilder<T, S>, S extends Target> {
...
}
The type T
is defined to be a subtype of AbstractTargetBuilder<T,S>
. What's the use of this pattern?
This code belongs to Spotlight
library:
https://github.com/TakuSemba/Spotlight/blob/master/spotlight/src/main/java/com/takusemba/spotlight/target/AbstractTargetBuilder.java