• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Required类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.beam.sdk.options.Validation.Required的典型用法代码示例。如果您正苦于以下问题:Java Required类的具体用法?Java Required怎么用?Java Required使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Required类属于org.apache.beam.sdk.options.Validation包,在下文中一共展示了Required类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: prettyPrintRequiredGroups

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
/**
 * Output the requirement groups that the property is a member of, including all properties that
 * satisfy the group requirement, breaking up long lines on white space characters and attempting
 * to honor a line limit of {@code TERMINAL_WIDTH}.
 */
private static void prettyPrintRequiredGroups(PrintStream out, Required annotation,
    SortedSetMultimap<String, String> requiredGroupNameToProperties) {
  if (annotation == null || annotation.groups() == null) {
    return;
  }
  for (String group : annotation.groups()) {
    SortedSet<String> groupMembers = requiredGroupNameToProperties.get(group);
    String requirement;
    if (groupMembers.size() == 1) {
      requirement = Iterables.getOnlyElement(groupMembers) + " is required.";
    } else {
      requirement = "At least one of " + groupMembers + " is required";
    }
    terminalPrettyPrint(out, requirement.split("\\s+"));
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:22,代码来源:PipelineOptionsFactory.java


示例2: getRequiredGroupNamesToProperties

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
/**
 * Returns a map of required groups of arguments to the properties that satisfy the requirement.
 */
private static SortedSetMultimap<String, String> getRequiredGroupNamesToProperties(
    Map<String, Method> propertyNamesToGetters) {
  SortedSetMultimap<String, String> result = TreeMultimap.create();
  for (Map.Entry<String, Method> propertyEntry : propertyNamesToGetters.entrySet()) {
    Required requiredAnnotation =
        propertyEntry.getValue().getAnnotation(Validation.Required.class);
    if (requiredAnnotation != null) {
      for (String groupName : requiredAnnotation.groups()) {
        result.put(groupName, propertyEntry.getKey());
      }
    }
  }
  return result;
}
 
开发者ID:apache,项目名称:beam,代码行数:18,代码来源:PipelineOptionsFactory.java


示例3: getSqlAddressFromLauncher

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Description("MS SQL Server address reachable from the launcher machine")
@Required
String getSqlAddressFromLauncher();
 
开发者ID:favsto,项目名称:sql-to-bigquery-dataflow,代码行数:4,代码来源:MsSqlMigrator.java


示例4: getSqlAddressFromPipeline

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Description("MS SQL Server address reachable from the pipeline")
@Required
String getSqlAddressFromPipeline();
 
开发者ID:favsto,项目名称:sql-to-bigquery-dataflow,代码行数:4,代码来源:MsSqlMigrator.java


示例5: getSqlPort

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Description("MS SQL Server port number")
@Default.Integer(1433)
@Required
Integer getSqlPort();
 
开发者ID:favsto,项目名称:sql-to-bigquery-dataflow,代码行数:5,代码来源:MsSqlMigrator.java


示例6: getSqlCatalog

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Description("MS SQL Server source catalog name")
@Required
String getSqlCatalog();
 
开发者ID:favsto,项目名称:sql-to-bigquery-dataflow,代码行数:4,代码来源:MsSqlMigrator.java


示例7: getSqlUsername

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Description("MS SQL Server username")
@Default.String("migrator")
@Required
String getSqlUsername();
 
开发者ID:favsto,项目名称:sql-to-bigquery-dataflow,代码行数:5,代码来源:MsSqlMigrator.java


示例8: getSqlPassword

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Description("MS SQL Server password")
@Required
String getSqlPassword();
 
开发者ID:favsto,项目名称:sql-to-bigquery-dataflow,代码行数:4,代码来源:MsSqlMigrator.java


示例9: getBigQueryDataset

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Description("BigQuery dataset name")
@Required
String getBigQueryDataset();
 
开发者ID:favsto,项目名称:sql-to-bigquery-dataflow,代码行数:4,代码来源:MsSqlMigrator.java


示例10: getOutput

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
/**
 * Set this required option to specify where to write the output.
 */
@Description("Path of the file to write to")
@Required
String getOutput();
 
开发者ID:apache,项目名称:beam,代码行数:7,代码来源:WordCount.java


示例11: printHelp

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
/**
 * Outputs the set of options available to be set for the passed in {@link PipelineOptions}
 * interface. The output is in a human readable format. The format is:
 * <pre>
 * OptionGroup:
 *     ... option group description ...
 *
 *  --option1={@code <type>} or list of valid enum choices
 *     Default: value (if available, see {@link Default})
 *     ... option description ... (if available, see {@link Description})
 *     Required groups (if available, see {@link Required})
 *  --option2={@code <type>} or list of valid enum choices
 *     Default: value (if available, see {@link Default})
 *     ... option description ... (if available, see {@link Description})
 *     Required groups (if available, see {@link Required})
 * </pre>
 * This method will attempt to format its output to be compatible with a terminal window.
 */
public static void printHelp(PrintStream out, Class<? extends PipelineOptions> iface) {
  checkNotNull(out);
  checkNotNull(iface);
  validateWellFormed(iface, REGISTERED_OPTIONS);

  Set<PipelineOptionSpec> properties =
      PipelineOptionsReflector.getOptionSpecs(iface);

  RowSortedTable<Class<?>, String, Method> ifacePropGetterTable = TreeBasedTable.create(
      ClassNameComparator.INSTANCE, Ordering.natural());
  for (PipelineOptionSpec prop : properties) {
    ifacePropGetterTable.put(prop.getDefiningInterface(), prop.getName(), prop.getGetterMethod());
  }

  for (Map.Entry<Class<?>, Map<String, Method>> ifaceToPropertyMap :
      ifacePropGetterTable.rowMap().entrySet()) {
    Class<?> currentIface = ifaceToPropertyMap.getKey();
    Map<String, Method> propertyNamesToGetters = ifaceToPropertyMap.getValue();

    SortedSetMultimap<String, String> requiredGroupNameToProperties =
        getRequiredGroupNamesToProperties(propertyNamesToGetters);

    out.format("%s:%n", currentIface.getName());
    prettyPrintDescription(out, currentIface.getAnnotation(Description.class));

    out.println();

    List<String> lists = Lists.newArrayList(propertyNamesToGetters.keySet());
    Collections.sort(lists, String.CASE_INSENSITIVE_ORDER);
    for (String propertyName : lists) {
      Method method = propertyNamesToGetters.get(propertyName);
      String printableType = method.getReturnType().getSimpleName();
      if (method.getReturnType().isEnum()) {
        printableType = Joiner.on(" | ").join(method.getReturnType().getEnumConstants());
      }
      out.format("  --%s=<%s>%n", propertyName, printableType);
      Optional<String> defaultValue = getDefaultValueFromAnnotation(method);
      if (defaultValue.isPresent()) {
        out.format("    Default: %s%n", defaultValue.get());
      }
      prettyPrintDescription(out, method.getAnnotation(Description.class));
      prettyPrintRequiredGroups(out, method.getAnnotation(Validation.Required.class),
          requiredGroupNameToProperties);
    }
    out.println();
  }
}
 
开发者ID:apache,项目名称:beam,代码行数:66,代码来源:PipelineOptionsFactory.java


示例12: getOutput

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
/**
 * Set this option to specify where to write the output, default is /tmp/output.
 * The output directory should not exist on HDFS.
 */
@Description("Path of the file to write to")
@Required
@Default.String("/tmp/output/")
String getOutput();
 
开发者ID:tweise,项目名称:apex-samples,代码行数:9,代码来源:Application.java


示例13: getBigtableInstanceId

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Required
@Description("The Google Cloud Bigtable instance ID .")
String getBigtableInstanceId();
 
开发者ID:GoogleCloudPlatform,项目名称:cloud-bigtable-examples,代码行数:4,代码来源:JobOptions.java


示例14: getBigtableTableId

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Required
@Description("The Cloud Bigtable table ID in the instance." )
String getBigtableTableId();
 
开发者ID:GoogleCloudPlatform,项目名称:cloud-bigtable-examples,代码行数:4,代码来源:JobOptions.java


示例15: getVariantSetId

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Required
@Description("The ID of the Google Genomics variant set this pipeline is accessing.")
String getVariantSetId();
 
开发者ID:googlegenomics,项目名称:dataflow-java,代码行数:4,代码来源:CallSetNamesOptions.java


示例16: getInput

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Description("The Cloud Storage filepath to a comma-separated or tab-separated file of variant ids. "
    + "The variant id will be retrieved from the first column.  Any other columns will be ignored. "
    + "The file should not include any header lines.")
@Required
String getInput();
 
开发者ID:googlegenomics,项目名称:dataflow-java,代码行数:6,代码来源:DeleteVariants.java


示例17: getVariantSetId

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Override
@Description("The ID of the Google Genomics variant set from which this pipeline "
    + "will identify private variants.")
@Required
String getVariantSetId();
 
开发者ID:googlegenomics,项目名称:dataflow-java,代码行数:6,代码来源:IdentifyPrivateVariants.java


示例18: getCallSetNamesFilepath

import org.apache.beam.sdk.options.Validation.Required; //导入依赖的package包/类
@Override
@Description("A local file path to a list of newline-separated callset names. "
    + "Any variants private to those callsets will be identified.")
@Required
String getCallSetNamesFilepath();
 
开发者ID:googlegenomics,项目名称:dataflow-java,代码行数:6,代码来源:IdentifyPrivateVariants.java



注:本文中的org.apache.beam.sdk.options.Validation.Required类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ContentNode类代码示例发布时间:2022-05-22
下一篇:
Java OfflineRegionError类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap