In an interface, I have a method that is okay to use in one implementation, but shouldn't be used in another. I'm thinking of throwing an exception if somebody were to use that method in that particular implementation. (which is not to say it's easy to accidentally come across that exception)
To be more specific, the method is getPlayer(String)
, which gets a Player
by name. Player
is a client connected to a server, however in my 2nd implementation, it would be impossible to get any connected clients, as the 2nd implementation represents other (cached and technically offline) servers which are stored in a list somewhere.
Any help is appreciated. Let me know if code pastes would better help describe the nature of the scenario.