de.javakaffee.web.msm.Reflections Maven / Gradle / Ivy
package de.javakaffee.web.msm;
import java.lang.reflect.Method;
final class Reflections {
private Reflections() {
}
@SuppressWarnings("unchecked")
static T invoke(final Object obj, final String methodName, final T defaultValue) {
try {
final Method method = obj.getClass().getMethod(methodName);
return (T) method.invoke(obj);
} catch (final Exception e) {
return defaultValue;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy