Gets the p-value according to the requested method.

@param method one of "t", "pairedT", "wilcoxon"
@return the p-value according to the requested method
177796
public double getPValue(final String method) {
        double p = Double.NaN;

        if ("t".equals(method)) {
            double[] baselineValues = new double[baselineMetricPerDimension.values().size()];
            int i = 0;
            for (Double d : baselineMetricPerDimension.values()) {
                baselineValues[i] = d;
                i++;
            }

            double[] testValues = new double[testMetricPerDimension.values().size()];
            i = 0;
            for (Double d : testMetricPerDimension.values()) {
                testValues[i] = d;
                i++;
            }

            p = TestUtils.tTest(baselineValues, testValues);
        } else {
            double[] baselineValues = new double[dimensions.size()];
            int i = 0;
            for (Object d : dimensions) {
                baselineValues[i] = baselineMetricPerDimension.get(d);
                i++;
            }

            double[] testValues = new double[dimensions.size()];
            i = 0;
            for (Object d : dimensions) {
                testValues[i] = testMetricPerDimension.get(d);
                i++;
            }
            if ("pairedT".equals(method)) {
                p = TestUtils.pairedTTest(baselineValues, testValues);
            } else if ("wilcoxon".equals(method)) {
                p = new WilcoxonSignedRankTest().wilcoxonSignedRankTest(baselineValues, testValues, false);
            }
        }
        return p;
    }
280673
private Object getValue(Method method) throws VarExploderException
    {
        try
        {
            if (method == null)
            {
                return null;
            }
            return method.invoke(source);
        }
        catch (IllegalArgumentException e)
        {
            throw new VarExploderException(e);
        }
        catch (IllegalAccessException e)
        {
            throw new VarExploderException(e);
        }
        catch (InvocationTargetException e)
        {
            throw new VarExploderException(e);
        }
    }
46774
public static String[] getParameterNames(Method method) {
		// AssertUtil.assertNotNull(method, "参数method不能为空.");
		Class<?> clazz = method.getDeclaringClass();
		return getParameterNames(clazz, method);
	}
475460
private static String getStatisticsName(Method m)
   {
      StringBuilder sb = new StringBuilder();
      sb.append(m.getName());
      sb.append('(');
      Class<?>[] types = m.getParameterTypes();
      if (types != null)
      {
         boolean first = true;
         for (Class<?> type : types)
         {
            if (first)
            {
               first = false;
            }
            else
            {
               sb.append(", ");
            }
            sb.append(type.getSimpleName());
         }
      }
      sb.append(')');
      return sb.toString();
   }
363614
public final Invokable<T, Object> method(Method method) {
    checkArgument(of(method.getDeclaringClass()).isAssignableFrom(this),
        "%s not declared by %s", method, this);
    return new Invokable.MethodInvokable<T>(method) {
      @Override Type getGenericReturnType() {
        return resolveType(super.getGenericReturnType()).getType();
      }
      @Override Type[] getGenericParameterTypes() {
        return resolveInPlace(super.getGenericParameterTypes());
      }
      @Override Type[] getGenericExceptionTypes() {
        return resolveInPlace(super.getGenericExceptionTypes());
      }
      @Override public TypeToken<T> getOwnerType() {
        return TypeToken.this;
      }
      @Override public String toString() {
        return getOwnerType() + "." + super.toString();
      }
    };
  }
331966
@Override
    public void setMethod(byte[] method) throws UnsupportedMethodException {
        MethodValues val = MethodValues.match(method, 0, method.length);
        if (null == val) {
            throw new UnsupportedMethodException("Illegal method " + GenericUtils.getEnglishString(method));
        }
        setMethod(val);
    }
741066
public static boolean isGetter(Method method) {
        String name = method.getName();
        String[] splitname = StringUtils.splitByCharacterTypeCamelCase(name);
        return !method.getReturnType().equals(void.class) && Modifier.isPublic(method.getModifiers())
                && (splitname[0].equals(GETTER_PREFIX_BOOLEAN) || splitname[0].equals(GETTER_PREFIX));
    }
1255534
public static String getSetKey(ExecutableElement method) {
    StringBuilder result = new StringBuilder();
    AnnotationMirror qualifier = getQualifier(method.getAnnotationMirrors());
    if (qualifier != null) {
      qualifierToString(qualifier, result);
    }
    result.append(SET_PREFIX);
    typeToString(method.getReturnType(), result, '$');
    result.append(">");
    return result.toString();
  }
593329
public static BeanParser getBeanParser(Method method) {
    Type returnType = method.getReturnType();
    if (isCompletableFutureType(method.getReturnType())) {
      returnType = getActualReturnType(method);
    }
    BeanParser beanParser = typeBeanParserMap.get(returnType);
    if (beanParser != null) {
      return beanParser;
    }
    return defaultBeanParser;
  }
1282901
private static List<MethodParameterDto> _getMethodParams(Method method) {
        List<MethodParameterDto> result = new ArrayList<>();
        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        Class<?>[] parameterTypes = method.getParameterTypes();

        for (int i = 0; i < parameterTypes.length; i++) {
            Class<?> parameterType = parameterTypes[i];
            Annotation[] annotations = parameterAnnotations[i];

            if (annotations.length > 0) {
            	
            	if (Context.class.isAssignableFrom(annotations[0].getClass())) {
                	continue;
                }
            	
            	MethodParameterDto param = new MethodParameterDto();
                for (int j = 0; j < annotations.length; j++) {
                    Annotation annotation = annotations[j];
                        
                    if (QueryParam.class.isAssignableFrom(annotation.getClass())) {
                        QueryParam queryParam = QueryParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("query");
                    } else if (FormParam.class.isAssignableFrom(annotation.getClass())) {
                        FormParam queryParam = FormParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("form");
                    } else if (PathParam.class.isAssignableFrom(annotation.getClass())) {
                        PathParam queryParam = PathParam.class.cast(annotation);

                        param.setName(queryParam.value());
                        param.setParamType("path");
                    } else if (DefaultValue.class.isAssignableFrom(annotation.getClass())) {
                    	DefaultValue defaultValue = DefaultValue.class.cast(annotation);
                    	
                    	param.setDefaultValue(defaultValue.value());
                    }
                    
                    try {
                        if (BaseDto.class.isAssignableFrom(parameterType)) {
                            param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
                        }
                    } catch (Exception ex) {
                        param.setSchema(parameterType);
                    }

                    String paramName = parameterType.getSimpleName().toLowerCase();
                    param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
                }
                
                result.add(param);
            } else {
            	MethodParameterDto param = new MethodParameterDto();
                String paramName = parameterType.getSimpleName().toLowerCase();

                param.setDataType(paramName.toLowerCase().replaceAll("dto", ""));
                param.setName("body");
                param.setParamType("body");
                try {
                    if (BaseDto.class.isAssignableFrom(parameterType)) {
                        param.setSchema(BaseDto.class.cast(parameterType.newInstance()).createExample());
                    }
                } catch (Exception ex) {
                    param.setSchema(parameterType);
                }
                result.add(param);
            } // end if-else
        } // end for
        return result;
    }
938488
public double getEffectSize(final String method) {
        if ("d".equals(method)) {
            return getCohenD(baselineMetricPerDimension, testMetricPerDimension, false);
        } else if ("dLS".equals(method)) {
            return getCohenD(baselineMetricPerDimension, testMetricPerDimension, true);
        } else if ("pairedT".equals(method)) {
            return getEffectSizePairedT(baselineMetricPerDimension, testMetricPerDimension);
        }
        return Double.NaN;
    }
892901
String getStaticTopic(Method method) {
		if(null == method || !method.isAnnotationPresent(JsTopic.class) ) {
			return null;
		}
		JsTopic jsTopic = method.getAnnotation(JsTopic.class);
		return jsTopic.value();
	}
856482
public ImmutableList<ASTParameter> getParameters(Method method) {
        return getParameters(method.getParameterTypes(), method.getGenericParameterTypes(), method.getParameterAnnotations());
    }
371074
static ObjectMethod objectMethodToOverride(ExecutableElement method) {
    String name = method.getSimpleName().toString();
    switch (method.getParameters().size()) {
      case 0:
        if (name.equals("toString")) {
          return ObjectMethod.TO_STRING;
        } else if (name.equals("hashCode")) {
          return ObjectMethod.HASH_CODE;
        }
        break;
      case 1:
        if (name.equals("equals")) {
          TypeMirror param = getOnlyElement(method.getParameters()).asType();
          if (param.getKind().equals(TypeKind.DECLARED)) {
            TypeElement paramType = MoreTypes.asTypeElement(param);
            if (paramType.getQualifiedName().contentEquals("java.lang.Object")) {
              return ObjectMethod.EQUALS;
            }
          }
        }
        break;
      default:
        // No relevant Object methods have more than one parameter.
    }
    return ObjectMethod.NONE;
  }
1374995
private MethodMetaData<? extends Annotation> getMethodMetaData(Method method) {
      MethodMetaData<? extends Annotation> methodMetaData = methodMetaDataCache.get(method);

      if (methodMetaData == null) {
         final String cacheName;
         final Annotation cacheAnnotation;
         final AggregatedParameterMetaData aggregatedParameterMetaData;
         final CacheKeyGenerator cacheKeyGenerator;
         final CacheDefaults cacheDefaultsAnnotation = method.getDeclaringClass().getAnnotation(CacheDefaults.class);

         if (method.isAnnotationPresent(CacheResult.class)) {
            final CacheResult cacheResultAnnotation = method.getAnnotation(CacheResult.class);
            cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheResultAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);
            cacheName = getCacheName(method, cacheResultAnnotation.cacheName(), cacheDefaultsAnnotation, true);
            aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false);
            cacheAnnotation = cacheResultAnnotation;

         } else if (method.isAnnotationPresent(CacheRemove.class)) {
            final CacheRemove cacheRemoveEntryAnnotation = method.getAnnotation(CacheRemove.class);
            cacheKeyGenerator = getCacheKeyGenerator(beanManager, cacheRemoveEntryAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);
            cacheName = getCacheName(method, cacheRemoveEntryAnnotation.cacheName(), cacheDefaultsAnnotation, false);
            aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false);
            cacheAnnotation = cacheRemoveEntryAnnotation;

            if (cacheName.isEmpty()) {
               throw log.cacheRemoveEntryMethodWithoutCacheName(method.getName());
            }

         } else if (method.isAnnotationPresent(CacheRemoveAll.class)) {
            final CacheRemoveAll cacheRemoveAllAnnotation = method.getAnnotation(CacheRemoveAll.class);
            cacheKeyGenerator = null;
            cacheName = getCacheName(method, cacheRemoveAllAnnotation.cacheName(), cacheDefaultsAnnotation, false);
            aggregatedParameterMetaData = getAggregatedParameterMetaData(method, false);
            cacheAnnotation = cacheRemoveAllAnnotation;

            if (cacheName.isEmpty()) {
               throw log.cacheRemoveAllMethodWithoutCacheName(method.getName());
            }

         } else if (method.isAnnotationPresent(CachePut.class)) {
            final CachePut cachePutAnnotation = method.getAnnotation(CachePut.class);
            cacheKeyGenerator = getCacheKeyGenerator(beanManager, cachePutAnnotation.cacheKeyGenerator(), cacheDefaultsAnnotation);
            cacheName = getCacheName(method, cachePutAnnotation.cacheName(), cacheDefaultsAnnotation, true);
            aggregatedParameterMetaData = getAggregatedParameterMetaData(method, true);
            cacheAnnotation = cachePutAnnotation;

         } else {
            throw log.methodWithoutCacheAnnotation(method.getName());
         }

         final MethodMetaData<? extends Annotation> newCacheMethodMetaData = new MethodMetaData<Annotation>(
               method,
               aggregatedParameterMetaData,
               asSet(method.getAnnotations()),
               cacheKeyGenerator,
               cacheAnnotation,
               cacheName
         );

         methodMetaData = methodMetaDataCache.putIfAbsent(method, newCacheMethodMetaData);
         if (methodMetaData == null) {
            methodMetaData = newCacheMethodMetaData;
         }
      }

      return methodMetaData;
   }
130971
public MethodDoc getMatchingMethod(MethodDoc method) {

        MethodDoc[] methods = getMethods();
        for (int i = 0; i < methods.length; i++) {

            if (method.getName().equals(methods[i].getName()) &&
                method.getSignature().equals(methods[i].getSignature())) {

                return methods[i];
            }
        }
        return null;
    }
1074757
protected static String getMethodSignature(Method method) {
    return getMethodSignature(method.getName(), method.getParameterTypes(), method.getReturnType());
  }