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

io.github.rongaru.javaee.utilities.MethodUtils Maven / Gradle / Ivy

package io.github.rongaru.javaee.utilities;

import java.lang.reflect.Method;

public abstract class MethodUtils {

	public static < T > T invokeStaticMethod( Method method, Object args ) {
		try {
			return ( T ) method.invoke( null, args );
		} catch ( Exception e ) {
			throw new RuntimeException( e );
		}
	}

	public static < T > T invokeStaticMethod( Method method, Object... args ) {
		try {
			return ( T ) method.invoke( null, args );
		} catch ( Exception e ) {
			throw new RuntimeException( e );
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy