public static boolean isVoidMethod()

in module/geb-implicit-assertions/src/main/groovy/geb/transform/implicitassertions/Runtime.java [30:51]


    public static boolean isVoidMethod(Object target, String method, Object... args) {

        if (target == null) {
            return false;
        }

        Class[] argTypes = new Class[args.length];
        int i = 0;
        for (Object arg : args) {
            argTypes[i++] = arg == null ? null : arg.getClass();
        }

        MetaClass metaClass = target instanceof Class ? InvokerHelper.getMetaClass((Class) target) : InvokerHelper.getMetaClass(target);

        MetaMethod metaMethod = metaClass.pickMethod(method, argTypes);
        if (metaMethod == null) {
            return false;
        }

        Class returnType = metaMethod.getReturnType();
        return returnType == void.class || returnType == Void.class;
    }