Class<?> Feeds me from a third-party .jar related to the type of the method parameter. I need to perform different actions based on the fact that this is actually a Class<?> .
If this is some kind of subclass of java.lang.Number (e.g. Integer or BigDecimal ), I need to follow a special course of action.
I can not use instanceof . And I'm afraid that if I use:
Class<?> someClass = getParameterTypeFrom3rdParty(); if(someClass == Number.class)
Then it will execute if Class<?> Is just Number . How can I include inheritance in a mix to get all subtypes of Number ?
Thanks in advance!
source share