com.google.errorprone.annotations.Var类的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中com.google.errorprone.annotations.Var类的一些代码示例,展示了Var类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Var类的具体详情如下:
包路径:com.google.errorprone.annotations.Var
类名称:Var

Var介绍

暂无

代码示例

代码示例来源:origin: uber/okbuck

public String getBuckName() {
  @Var RuleType ruleType = this;
  switch (this) {
   case KOTLIN_ANDROID_LIBRARY:
   case ANDROID_LIBRARY:
    ruleType = ANDROID_LIBRARY;
    break;
   case KOTLIN_ROBOLECTRIC_TEST:
   case ROBOLECTRIC_TEST:
    ruleType = ROBOLECTRIC_TEST;
    break;
   default:
    break;
  }

  return ruleType.name().toLowerCase();
 }
}

代码示例来源:origin: uber/okbuck

private static Pair<String, String> getBashCommandAndTransformDeps(
  AndroidAppTarget target, Map<String, String> options) {
 String transformClass = options.get(OPT_TRANSFORM_CLASS);
 String configFile = options.get(OPT_CONFIG_FILE);
 StringBuilder bashCmd = new StringBuilder(PREFIX);
 @Var String configFileRule = null;
 if (transformClass != null) {
  bashCmd.append("-Dokbuck.transformClass=").append(transformClass).append(" ");
 }
 if (configFile != null) {
  configFileRule =
    getTransformConfigRuleForFile(
      target.getProject(), target.getRootProject().file(configFile));
  bashCmd.append("-Dokbuck.configFile=$(location ").append(configFileRule).append(") ");
 }
 bashCmd.append(SUFFIX);
 return Pair.of(bashCmd.toString(), configFileRule);
}

代码示例来源:origin: uber/okbuck

.collect(Collectors.joining(",\n"));
@Var
String nameExpr =
  names.stream().map(name -> "\"" + name + "\"").collect(Collectors.joining(", "));

代码示例来源:origin: uber/okbuck

@Nullable
 Target getTargetForVariant(@Nullable String variant) {
  @Var Target result = null;
  ProjectType type = ProjectUtil.getType(project);
  switch (type) {
   case ANDROID_LIB:
    result = getTargets().get(variant);
    if (result == null) {
     throw new IllegalStateException(
       "No target found for " + project.getDisplayName() + " for variant " + variant);
    }
    break;
   case GROOVY_LIB:
   case JAVA_LIB:
   case KOTLIN_LIB:
   case SCALA_LIB:
    result = getTargets().values().iterator().next();
    break;
   default:
    break;
  }
  return result;
 }
}

代码示例来源:origin: uber/okbuck

@Nullable
private Configuration getConfigurationFromVariant(@Nullable BaseVariant variant) {
 @Var Configuration configuration = null;
 if (isKapt) {
  configuration =
    getProject()
      .getConfigurations()
      .getByName("kapt" + StringUtils.capitalize(getBaseVariant().getName()));
 } else if (variant != null) {
  configuration = variant.getAnnotationProcessorConfiguration();
 }
 return configuration;
}

代码示例来源:origin: uber/okbuck

return null;
@Var String appClass = null;

代码示例来源:origin: uber/okbuck

@Var
boolean autoValueDependency =
  dependencySet

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code advice}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + advice.hashCode();
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code host}, {@code port}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + host.hashCode();
 h += (h << 5) + port;
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code loggerName}, {@code partialMessage}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + loggerName.hashCode();
 h += (h << 5) + partialMessage.hashCode();
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code message}, {@code throwable}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + message.hashCode();
 h += (h << 5) + Objects.hashCode(throwable);
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code className}, {@code codeSource}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + className.hashCode();
 h += (h << 5) + Objects.hashCode(codeSource);
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code directory}, {@code jarFile}, {@code jarFileInsideJarFile}, {@code directoryInsideJarFile}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + Objects.hashCode(directory);
 h += (h << 5) + Objects.hashCode(jarFile);
 h += (h << 5) + Objects.hashCode(jarFileInsideJarFile);
 h += (h << 5) + Objects.hashCode(directoryInsideJarFile);
 return h;
}

代码示例来源:origin: uber/okbuck

@Var boolean hasKotlinExtension;
try {
 AndroidExtensionsExtension androidExtensions =

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code object}, {@code name}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + object.hashCode();
 h += (h << 5) + name.hashCode();
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code defaultThresholdNanos}, {@code thresholdNanos}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + Objects.hashCode(defaultThresholdNanos);
 h += (h << 5) + thresholdNanos.hashCode();
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code type}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + type.hashCode();
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code name}, {@code parameterTypes}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + name.hashCode();
 h += (h << 5) + parameterTypes.hashCode();
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code stackTrace}, {@code framesInCommonWithEnclosing}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + stackTrace.hashCode();
 h += (h << 5) + framesInCommonWithEnclosing;
 return h;
}

代码示例来源:origin: glowroot/glowroot

/**
 * Computes a hash code from attributes: {@code name}, {@code parameterTypes}.
 * @return hashCode value
 */
@Override
public int hashCode() {
 @Var int h = 5381;
 h += (h << 5) + name.hashCode();
 h += (h << 5) + parameterTypes.hashCode();
 return h;
}

相关文章

微信公众号

最新文章

更多

Var类方法