org.apache.commons.cli.Option.setType()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(151)

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

Option.setType介绍

[英]Sets the type of this Option.
[中]

代码示例

代码示例来源:origin: commons-cli/commons-cli

/**
 * Sets the type of this Option.
 * <p>
 * <b>Note:</b> this method is kept for binary compatibility and the
 * input type is supposed to be a {@link Class} object. 
 *
 * @param type the type of this Option
 * @deprecated since 1.3, use {@link #setType(Class)} instead
 */
@Deprecated
public void setType(Object type)
{
  setType((Class<?>) type);
}

代码示例来源:origin: dreamhead/moco

public static Option shutdownPortOption() {
    Option opt = new Option("s", true, "shutdown port");
    opt.setType(String.class);
    opt.setRequired(false);
    return opt;
  }
}

代码示例来源:origin: dreamhead/moco

protected final Option cert() {
  Option option = new Option(null, "cert", true, "Cert password");
  option.setType(String.class);
  option.setRequired(false);
  return option;
}

代码示例来源:origin: dreamhead/moco

protected final Option configOption() {
  Option opt = new Option("c", true, "config");
  opt.setType(String.class);
  opt.setRequired(false);
  return opt;
}

代码示例来源:origin: dreamhead/moco

protected final Option httpsCertificate() {
  Option option = new Option(null, "https", true, "Https certificate filename");
  option.setType(String.class);
  option.setRequired(false);
  return option;
}

代码示例来源:origin: dreamhead/moco

protected final Option envOption() {
  Option opt = new Option("e", true, "environment");
  opt.setType(String.class);
  opt.setRequired(false);
  return opt;
}

代码示例来源:origin: dreamhead/moco

protected final Option keyStore() {
  Option option = new Option(null, "keystore", true, "Key store password");
  option.setType(String.class);
  option.setRequired(false);
  return option;
}

代码示例来源:origin: dreamhead/moco

protected final Option portOption() {
  Option opt = new Option("p", true, "port");
  opt.setType(Number.class);
  opt.setRequired(false);
  return opt;
}

代码示例来源:origin: dreamhead/moco

protected final Option settingsOption() {
  Option opt = new Option("g", true, "global settings");
  opt.setType(String.class);
  opt.setRequired(false);
  return opt;
}

代码示例来源:origin: commons-cli/commons-cli

option.setOptionalArg(optionalArg);
option.setArgs(numberOfArgs);
option.setType(type);
option.setValueSeparator(valuesep);
option.setArgName(argName);

代码示例来源:origin: apache/ignite

cfg.setType(String.class);
minTtl.setType(Long.class);
maxTtl.setType(Long.class);
duration.setType(Long.class);
log.setType(String.class);

代码示例来源:origin: apache/ignite

/**
   * Creates cli options.
   *
   * @return Command line options
   */
  private static Options createOptions() {
    Options options = new Options();

    OptionGroup grp = new OptionGroup();

    grp.setRequired(true);

    Option cfg = new Option(OPTION_CFG, null, true, "path to Spring XML configuration file.");

    cfg.setArgName("file");

    Option n = new Option(null, OPTION_N, true, "nodes count.");

    n.setValueSeparator('=');
    n.setType(Integer.class);

    grp.addOption(cfg);
    grp.addOption(n);

    options.addOptionGroup(grp);

    return options;
  }
}

代码示例来源:origin: com.github.dreamhead/moco-runner

protected Option settingsOption() {
  Option opt = new Option("g", true, "global settings");
  opt.setType(String.class);
  opt.setRequired(false);
  return opt;
}

代码示例来源:origin: YahooArchive/oozie

protected Options createSlaOptions() {
  Option oozie = new Option(OOZIE_OPTION, true, "Oozie URL");
  Option start = new Option(OFFSET_OPTION, true, "start offset (default '0')");
  Option len = new Option(LEN_OPTION, true, "number of results (default '100')");
  start.setType(Integer.class);
  len.setType(Integer.class);
  Options slaOptions = new Options();
  slaOptions.addOption(start);
  slaOptions.addOption(len);
  slaOptions.addOption(oozie);
  return slaOptions;
}

代码示例来源:origin: org.terracotta/terracotta-ee

public void addOption(String opt, String description, Class type, boolean isRequired) {
 Option option = new Option(opt, description);
 option.setType(type);
 option.setRequired(isRequired);
 options.addOption(option);
}

代码示例来源:origin: org.terracotta/terracotta-ee

public void addOption(String opt, boolean hasArg, String description, Class type, boolean isRequired) {
 Option option = new Option(opt, hasArg, description);
 option.setType(type);
 option.setRequired(isRequired);
 options.addOption(option);
}

代码示例来源:origin: org.terracotta/terracotta-ee

public void addOption(String opt, boolean hasArg, String description, Class type, boolean isRequired, String argName) {
 Option option = new Option(opt, hasArg, description);
 option.setType(type);
 option.setRequired(isRequired);
 option.setArgName(argName);
 options.addOption(option);
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

public void addOption(String opt, String longOpt, boolean hasArg, String description, Class type, boolean isRequired,
           String argName) {
 Option option = new Option(opt, longOpt, hasArg, description);
 option.setType(type);
 option.setRequired(isRequired);
 option.setArgName(argName);
 options.addOption(option);
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

public void addOption(String opt, String description, Class type, boolean isRequired, String argName) {
 Option option = new Option(opt, description);
 option.setType(type);
 option.setRequired(isRequired);
 option.setArgName(argName);
 options.addOption(option);
}

代码示例来源:origin: org.terracotta/terracotta-l1-ee

public void addOption(String opt, boolean hasArg, String description, Class type, boolean isRequired, String argName) {
 Option option = new Option(opt, hasArg, description);
 option.setType(type);
 option.setRequired(isRequired);
 option.setArgName(argName);
 options.addOption(option);
}

相关文章