/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.dubbo.common.utils;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;

public class MethodUtils {

    public static boolean isSetter(Method method) {
        return method.getName().startsWith("set")
                && !"set".equals(method.getName())
                && Modifier.isPublic(method.getModifiers())
                && method.getParameterCount() == 1
                && ClassUtils.isPrimitive(method.getParameterTypes()[0]);
    }

    public static boolean isGetter(Method method) {
        String name = method.getName();
        return (name.startsWith("get") || name.startsWith("is"))
                && !"get".equals(name) && !"is".equals(name)
                && !"getClass".equals(name) && !"getObject".equals(name)
                && Modifier.isPublic(method.getModifiers())
                && method.getParameterTypes().length == 0
                && ClassUtils.isPrimitive(method.getReturnType());
    }

    public static boolean isMetaMethod(Method method) {
        String name = method.getName();
        if (!(name.startsWith("get") || name.startsWith("is"))) {
            return false;
        }
        if ("get".equals(name)) {
            return false;
        }
        if ("getClass".equals(name)) {
            return false;
        }
        if (!Modifier.isPublic(method.getModifiers())) {
            return false;
        }
        if (method.getParameterTypes().length != 0) {
            return false;
        }
        if (!ClassUtils.isPrimitive(method.getReturnType())) {
            return false;
        }
        return true;
    }

    public static boolean isDeprecated(Method method) {
        return method.getAnnotation(Deprecated.class) != null;
    }
}

@@ -908,35 +908,401 @@
 r;%0A%0A
-public class MethodUtils %7B%0A
+/**%0A * Miscellaneous method utility methods.%0A * Mainly for internal use within the framework.%0A *%0A * @author LiZhenNet%0A * @since 2.7.2%0A */%0Apublic class MethodUtils %7B%0A%0A    /**%0A     * Return %7B@code true%7D if the provided method is a set method.%0A     * Otherwise, return %7B@code false%7D.%0A     *%0A     * @param method the method to check%0A     * @return whether the given method is setter method%0A     */
 %0A   
@@ -1635,32 +1635,260 @@
 s()%5B0%5D);%0A    %7D%0A%0A
+    /**%0A     * Return %7B@code true%7D if the provided method is a get method.%0A     * Otherwise, return %7B@code false%7D.%0A     *%0A     * @param method the method to check%0A     * @return whether the given method is getter method%0A     */%0A
     public stati
@@ -2346,32 +2346,251 @@
 Type());%0A    %7D%0A%0A
+    /**%0A     * Return %7B@code true%7D If this method is a meta method.%0A     * Otherwise, return %7B@code false%7D.%0A     *%0A     * @param method the method to check%0A     * @return whether the given method is meta method%0A     */%0A
     public stati
@@ -3222,24 +3222,392 @@
 rue;%0A    %7D%0A%0A
+    /**%0A     * Check if the method is a deprecated method. The standard is whether the %7B@link java.lang.Deprecated%7D annotation is declared on the class.%0A     * Return %7B@code true%7D if this annotation is present.%0A     * Otherwise, return %7B@code false%7D.%0A     *%0A     * @param method the method to check%0A     * @return whether the given method is deprecated method%0A     */%0A
     public s

enhance the java doc of dubbo-common module. (#5578)