gobblin.annotation.Alias.value()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(123)

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

Alias.value介绍

暂无

代码示例

代码示例来源:origin: com.linkedin.gobblin/gobblin-runtime

@Override
public String toString() {
 Alias alias = getClass().getAnnotation(Alias.class);
 return null != alias ? alias.value() : getClass().getName();
}

代码示例来源:origin: com.linkedin.gobblin/gobblin-api

public ClassAliasResolver(Class<T> subTypeOf) {
 Map<String, Class<? extends T>> cache = Maps.newHashMap();
 this.aliasObjects = Lists.newArrayList();
 for (Class<? extends T> clazz : REFLECTIONS.getSubTypesOf(subTypeOf)) {
  if (clazz.isAnnotationPresent(Alias.class)) {
   Alias aliasObject = clazz.getAnnotation(Alias.class);
   String alias = aliasObject.value().toUpperCase();
   if (cache.containsKey(alias)) {
    log.warn(String.format("Alias %s already mapped to class %s. Mapping for %s will be ignored", alias,
      cache.get(alias).getCanonicalName(), clazz.getCanonicalName()));
   } else {
    aliasObjects.add(aliasObject);
    cache.put(clazz.getAnnotation(Alias.class).value().toUpperCase(), clazz);
   }
  }
 }
 this.subtypeOf = subTypeOf;
 this.aliasToClassCache = ImmutableMap.copyOf(cache);
}

代码示例来源:origin: com.linkedin.gobblin/gobblin-runtime

private void listQuickApps() {
 List<Alias> aliases = getAllAliases();
 System.out.println("Usage: gobblin run <quick-app-name> [OPTIONS]");
 System.out.println("Available quick apps:");
 for (Alias thisAlias : aliases) {
  System.out.println(String.format("\t%s\t-\t%s", thisAlias.value(), thisAlias.description()));
 }
}

代码示例来源:origin: com.linkedin.gobblin/gobblin-utility

private static void printUsage(ClassAliasResolver<CliApplication> resolver) {
 System.out.println("Usage: gobblin <command>");
 System.out.println("Available commands:");
 for (Alias alias : resolver.getAliasObjects()) {
  System.out.println("\t" + alias.value() + "\t" + alias.description());
 }
}

相关文章