de.javakaffee.web.msm.Reflections Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of memcached-session-manager Show documentation
Show all versions of memcached-session-manager Show documentation
The msm core, provides java serialization strategy.
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;
}
}
}