All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.javakaffee.web.msm.Reflections Maven / Gradle / Ivy

There is a newer version: 2.3.2
Show newest version
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 - 2024 Weber Informatics LLC | Privacy Policy