is Method Boolean Getter - Android java.lang.reflect

Android examples for java.lang.reflect:Method Getter Setter

Description

is Method Boolean Getter

Demo Code


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

public class Main {
    static boolean isBooleanGetter(Method method) {
        return method != null
                && method.getName().startsWith("is")
                && method.getName().length() > 2
                && (method.getReturnType() == boolean.class || method
                        .getReturnType() == Boolean.class);
    }//from ww  w. j  av a 2  s .  co m
}

Related Tutorials