3 Answers
3

Your pattern class have to extends BasicObject and extends/implements CodeObject (which actually is an interface), so you can do it with multiple class declaring in wildcard definition of method signature, like that:

Yes but i don't want to do that. Of course any method could use myMethod(Object obj) and then use 'obj.isInstance(...)' but that's what im trying to avoid. I really want the users of my method to be forced to pass a good parameter.
–
GabMay 17 '12 at 19:06

Well, if you want to -force- it you could crash your program every time they do that (or just throw an IllegalArgumentException, i'm sure they will figure it out faster that way)
–
RikingMay 19 '12 at 16:18