当前位置: 首页>>代码示例>>Java>>正文


Java Equivalence.Wrapper方法代码示例

本文整理汇总了Java中com.google.common.base.Equivalence.Wrapper方法的典型用法代码示例。如果您正苦于以下问题:Java Equivalence.Wrapper方法的具体用法?Java Equivalence.Wrapper怎么用?Java Equivalence.Wrapper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.base.Equivalence的用法示例。


在下文中一共展示了Equivalence.Wrapper方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: allMethods

import com.google.common.base.Equivalence; //导入方法依赖的package包/类
/**
 * @return All candidate methods indexed by signature equivalence
 */
public Map<Equivalence.Wrapper<Method>, Collection<Method>> allMethods() {
    ImmutableMap.Builder<Equivalence.Wrapper<Method>, Collection<Method>> builder = ImmutableMap.builder();
    for (Map<Equivalence.Wrapper<Method>, Collection<Method>> candidatesForSomeName : candidates.values()) {
        builder.putAll(candidatesForSomeName);
    }
    return builder.build();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:CandidateMethods.java

示例2: methodsNamed

import com.google.common.base.Equivalence; //导入方法依赖的package包/类
/**
 * @param methodName Method name
 * @return Candidate methods named {@literal methodName} or {@literal null} if none
 */
Map<Equivalence.Wrapper<Method>, Collection<Method>> methodsNamed(String methodName) {
    if (candidates.containsKey(methodName)) {
        return candidates.get(methodName);
    }
    return Collections.<Equivalence.Wrapper<Method>, Collection<Method>>emptyMap();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:CandidateMethods.java

示例3: overriddenMethodsNamed

import com.google.common.base.Equivalence; //导入方法依赖的package包/类
/**
 * @param methodName Method name
 * @return Overridden candidate methods named {@literal methodName} indexed by signature equivalence or
 * {@literal null} if none
 */
public Map<Equivalence.Wrapper<Method>, Collection<Method>> overriddenMethodsNamed(String methodName) {
    if (candidates.containsKey(methodName)) {
        return Maps.filterValues(candidates.get(methodName), new Predicate<Collection<Method>>() {
            @Override
            public boolean apply(Collection<Method> equivalentMethods) {
                return equivalentMethods.size() > 1;
            }
        });
    }
    return Collections.<Equivalence.Wrapper<Method>, Collection<Method>>emptyMap();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:17,代码来源:CandidateMethods.java

示例4: overloadedMethodsNamed

import com.google.common.base.Equivalence; //导入方法依赖的package包/类
/**
 * @param methodName Method name
 * @return Overloaded candidate methods named {@literal methodName} indexed by signature equivalence or
 * {@literal null} if none
 */
Map<Equivalence.Wrapper<Method>, Collection<Method>> overloadedMethodsNamed(String methodName) {
    if (candidates.containsKey(methodName)) {
        Map<Equivalence.Wrapper<Method>, Collection<Method>> overloadeds = candidates.get(methodName);
        if (overloadeds.size() > 1) {
            return overloadeds;
        }
    }
    return Collections.<Equivalence.Wrapper<Method>, Collection<Method>>emptyMap();
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:15,代码来源:CandidateMethods.java

示例5: apply

import com.google.common.base.Equivalence; //导入方法依赖的package包/类
public Equivalence.Wrapper<Method> apply(@Nullable Method input) {
    return SIGNATURE_EQUIVALENCE.wrap(input);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:GroovyMethods.java

示例6: CandidateMethods

import com.google.common.base.Equivalence; //导入方法依赖的package包/类
public CandidateMethods(Map<String, Map<Equivalence.Wrapper<Method>, Collection<Method>>> candidates) {
    this.candidates = candidates;
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:4,代码来源:CandidateMethods.java

示例7: wrap

import com.google.common.base.Equivalence; //导入方法依赖的package包/类
private Equivalence.Wrapper<TypeMirror> wrap(TypeMirror typeMirror) {
    return MoreTypes.equivalence().wrap(typeMirror);
}
 
开发者ID:ccheptea,项目名称:auto-value-node,代码行数:4,代码来源:TypeMirrorSet.java

示例8: format

import com.google.common.base.Equivalence; //导入方法依赖的package包/类
/** Returns the formatted message for an exception with the specified messages. */
public static String format(String heading, Collection<Message> errorMessages) {
  Formatter fmt = new Formatter().format(heading).format(":%n%n");
  int index = 1;
  boolean displayCauses = getOnlyCause(errorMessages) == null;

  Map<Equivalence.Wrapper<Throwable>, Integer> causes = Maps.newHashMap();
  for (Message errorMessage : errorMessages) {
    int thisIdx = index++;
    fmt.format("%s) %s%n", thisIdx, errorMessage.getMessage());

    List<Object> dependencies = errorMessage.getSources();
    for (int i = dependencies.size() - 1; i >= 0; i--) {
      Object source = dependencies.get(i);
      formatSource(fmt, source);
    }

    Throwable cause = errorMessage.getCause();
    if (displayCauses && cause != null) {
      Equivalence.Wrapper<Throwable> causeEquivalence = ThrowableEquivalence.INSTANCE.wrap(cause);
      if (!causes.containsKey(causeEquivalence)) {
        causes.put(causeEquivalence, thisIdx);
        fmt.format("Caused by: %s", Throwables.getStackTraceAsString(cause));
      } else {
        int causeIdx = causes.get(causeEquivalence);
        fmt.format("Caused by: %s (same stack trace as error #%s)",
            cause.getClass().getName(), causeIdx);
      }
    }

    fmt.format("%n");
  }

  if (errorMessages.size() == 1) {
    fmt.format("1 error");
  } else {
    fmt.format("%s errors", errorMessages.size());
  }

  return fmt.toString();
}
 
开发者ID:maetrive,项目名称:businessworks,代码行数:42,代码来源:Errors.java

示例9: wrap

import com.google.common.base.Equivalence; //导入方法依赖的package包/类
private Equivalence.Wrapper<TypeMirror> wrap(TypeMirror typeMirror) {
  return MoreTypes.equivalence().wrap(typeMirror);
}
 
开发者ID:sopak,项目名称:auto-value-step-builder,代码行数:4,代码来源:TypeMirrorSet.java


注:本文中的com.google.common.base.Equivalence.Wrapper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。