2 ms·
class ObjectUtil { static boolean hasMethod(Object obj, String... methodNames) { for(String methodName : methodNames) if(!ha
by ZitchDog 17y ago
class ObjectUtil {
static boolean hasMethod(Object obj, String... methodNames) {
for(String methodName : methodNames)
if(!hasMethod(obj, methodName))
return false;
return true;
}
static boolean hasMethod(Object obj, String methodName) {
for(Method method : obj.getClass().getMethods())
if(method.getName().equals(methodName))
return true;
return false;
}
}