com.github.siwenyan.reflection.ReflectionUtils Maven / Gradle / Ivy
package com.github.siwenyan.reflection;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
public class ReflectionUtils {
public static boolean isStaticMethod(Method method) {
return 0 != (method.getModifiers() & Modifier.STATIC);
}
public static Class>[] types(Object[] args) {
int length = null == args ? 0 : args.length;
Class>[] types = new Class>[length];
if (length <= 0) {
return types;
}
for (int i = 0; i < length; i++) {
Class> clazz = args[i].getClass();
types[i] = clazz;
}
return types;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy