Tabnine Logo
ArgumentParser
Code IndexAdd Tabnine to your IDE (free)

How to use
ArgumentParser
in
com.netflix.hollow.api.codegen

Best Java code snippets using com.netflix.hollow.api.codegen.ArgumentParser (Showing top 8 results out of 315)

origin: Netflix/hollow

@Test
public void test_noCommands() {
  assertEquals(Arrays.asList(), new ArgumentParser<Commands>(Commands.class, new String[] {}).getParsedArguments());
}
origin: Netflix/hollow

@Test(expected = IllegalArgumentException.class)
public void test_missingDash() {
  new ArgumentParser<Commands>(Commands.class, new String[]{"-orderCoffee=f"});
}
origin: Netflix/hollow

@Test(expected = IllegalArgumentException.class)
public void test_missingArgument() {
  new ArgumentParser<Commands>(Commands.class, new String[]{"--compileOnFirstTry=f"});
}
origin: Netflix/hollow

  private void assertParsedArgument(String commandLineArg, Commands key, String value) {
    ArgumentParser<Commands>.ParsedArgument parsed = new ArgumentParser<>(Commands.class, new String[] {
      commandLineArg}).getParsedArguments().get(0);
    assertEquals(key, parsed.getKey());
    assertEquals(value, parsed.getValue());
  }
}
origin: Netflix/hollow

@Test(expected = IllegalArgumentException.class)
public void test_missingValue() {
  new ArgumentParser<Commands>(Commands.class, new String[]{"--orderCoffee"});
}
origin: Netflix/hollow

@Test
public void test_validCommands() {
  assertEquals(3, new ArgumentParser<Commands>(Commands.class, new String[] {
    "--orderCoffee=first", "--drinkCoffee=next", "--writeArgumentParserClass=yay"}).getParsedArguments().size());
  assertParsedArgument("--orderCoffee=fi.rst", Commands.orderCoffee, "fi.rst");
  assertParsedArgument("--drinkCoffee=ne/x--t", Commands.drinkCoffee, "ne/x--t");
  assertParsedArgument("--writeArgumentParserClass=compl_ete", Commands.writeArgumentParserClass, "compl_ete");
}
origin: Netflix/hollow

String pathToGeneratedFiles = null;
HollowObjectMapper mapper = new HollowObjectMapper(engine);
ArgumentParser<GeneratorArguments> argumentParser = new ArgumentParser(GeneratorArguments.class, args);
for (ArgumentParser<GeneratorArguments>.ParsedArgument arg : argumentParser.getParsedArguments()) {
  switch (arg.getKey()) {
    case addToDataModel:
origin: Netflix/hollow

HollowAPIGenerator.Builder builder = new HollowAPIGenerator.Builder();
HollowObjectMapper mapper = new HollowObjectMapper(engine);
ArgumentParser<GeneratorArguments> argumentParser = new ArgumentParser(GeneratorArguments.class, args);
for (ArgumentParser<GeneratorArguments>.ParsedArgument arg : argumentParser.getParsedArguments()) {
  switch (arg.getKey()) {
    case addToDataModel:
com.netflix.hollow.api.codegenArgumentParser

Most used methods

  • <init>
  • getParsedArguments

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now