Filter Method by method name - Android java.lang.reflect

Android examples for java.lang.reflect:Method

Description

Filter Method by method name

Demo Code


//package com.java2s;
import java.lang.reflect.Method;

public class Main {

    public static boolean haveMethod(Method[] methods, String fieldMethod) {
        for (Method met : methods) {
            if (fieldMethod.equals(met.getName())) {
                return true;
            }/*  www.ja va  2s.c o  m*/
        }
        return false;
    }
}

Related Tutorials