I want to use
Class.getMethod(String name, Class... parameterTypes)
to find the method I need to invoke with the given parameters, but apparent
Try using Class.isPrimitive()
to determine if it a primitive type, then if it is, use reflections to retrieve the TYPE
field and check if that is equal. So, in very liberal pseudocode:
for(Method m:getDeclaredMethods())
for(Class c:m.getParameterTypes() && Class desired:desiredMethodArgTypes)
if(c.isAssignableFrom(desired))
//matches
if(c.isPrimitive() && c==desired.getDeclaredField("TYPE").get(desiredObject))
//matches