集册 Java实例教程 是吸气剂法

是吸气剂法

欢马劈雪     最近更新时间:2020-01-02 10:19:05

392
是吸气剂法


//package com.nowjava;
/*
n  o  w  j  a  v  a . c o m 提供
*/

import java.lang.reflect.Method;


public class Main {


    public static final int SET_START = "set".length();


    public static final int IS_START = "is".length();


    public static boolean isGetter(Method method) {

        String name = method.getName();/*nowjava.com - 时代Java 提 供*/

        boolean hasNoParam = method.getParameterTypes().length == 0;

        boolean startsWithGet = (name.length() > SET_START)

                && name.startsWith("get");

        boolean startsWithIs = (name.le
展开阅读全文