I have a package with a
public abstract class Player { /*...*/ }
and these
public abstract class GamePlayer extends Player { /*...*/ }
public abstract class TournamentPlayer extends Player { /*...*/ }
public abstract class StatelessPlayer extends Player { /*...*/ }
Users of the package need Players but in order to use the package without breaking it I require that they never directly extend Player. Instead they should extend one of the subclasses provided.
Question: How should I prevent users from extending Player directly?
I'm looking for a way that makes it obvious that this prohibition is intended.