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

com.britesnow.snow.testsupport.ClassUtil Maven / Gradle / Ivy

There is a newer version: 2.0.9
Show newest version
package com.britesnow.snow.testsupport;

import java.lang.reflect.Method;

public class ClassUtil {

    
    /**
     * Convenient getter that get the first method with this given name (disregard arguments). 
     * Should be use in testing only code. 
     * 
     * @param cls
     * @param methodName
     * @return
     */
    public static Method getFirstMethod(Class cls, String methodName){
       for (Method m : cls.getMethods()){
           if (m.getName().equals(methodName)){
               return m;
           }
       }
       return null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy