Package org.crsh.cli.descriptor

Examples of org.crsh.cli.descriptor.OptionDescriptor


    class A {
      @Option(names = "o")
      int o;
    }
    CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class);
    OptionDescriptor i = c.getOption("-o");
    assertEquals(Multiplicity.SINGLE, i.getMultiplicity());
    assertEquals(false, i.isRequired());
    assertEquals(ValueType.INTEGER, i.getType());
  }
View Full Code Here


    class A {
      @Option(names = "o")
      Integer o;
    }
    CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class);
    OptionDescriptor i = c.getOption("-o");
    assertEquals(Multiplicity.SINGLE, i.getMultiplicity());
    assertEquals(false, i.isRequired());
    assertEquals(ValueType.INTEGER, i.getType());
  }
View Full Code Here

    class A {
      @Option(names = "o")
      List<Integer> o;
    }
    CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class);
    OptionDescriptor i = c.getOption("-o");
    assertEquals(Multiplicity.MULTI, i.getMultiplicity());
    assertEquals(ValueType.INTEGER, i.getType());
  }
View Full Code Here

    class A {
      @Option(names = "o")
      String o;
    }
    CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class);
    OptionDescriptor i = c.getOption("-o");
    assertEquals(Multiplicity.SINGLE, i.getMultiplicity());
    assertEquals(false, i.isRequired());
    assertEquals(ValueType.STRING, i.getType());
  }
View Full Code Here

    class A {
      @Option(names = "o")
      List<String> o;
    }
    CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class);
    OptionDescriptor i = c.getOption("-o");
    assertEquals(Multiplicity.MULTI, i.getMultiplicity());
    assertEquals(ValueType.STRING, i.getType());
  }
View Full Code Here

    class A {
      @Option(names = "o")
      boolean o;
    }
    CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class);
    OptionDescriptor i = c.getOption("-o");
    assertEquals(Multiplicity.SINGLE, i.getMultiplicity());
    assertEquals(false, i.isRequired());
    assertEquals(ValueType.BOOLEAN, i.getType());
  }
View Full Code Here

    class A {
      @Option(names = "o")
      Boolean o;
    }
    CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class);
    OptionDescriptor i = c.getOption("-o");
    assertEquals(Multiplicity.SINGLE, i.getMultiplicity());
    assertEquals(false, i.isRequired());
    assertEquals(ValueType.BOOLEAN, i.getType());
  }
View Full Code Here

    class A {
      @Option(names = "o")
      RetentionPolicy o;
    }
    CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class);
    OptionDescriptor i = c.getOption("-o");
    assertEquals(Multiplicity.SINGLE, i.getMultiplicity());
    assertEquals(false, i.isRequired());
    assertEquals(ValueType.ENUM, i.getType());
  }
View Full Code Here

  public void testSingleLetterName() throws Exception {
    class A {
      @Option(names = "o")
      RetentionPolicy o;
    }
    OptionDescriptor i = CommandFactory.DEFAULT.create(A.class).getOption("-o");
    assertEquals(Arrays.asList("o"), i.getNames());

    //
    class B {
      @Option(names = "-")
      RetentionPolicy o;
View Full Code Here

  public void testTwoLettersName() throws Exception {
    class A {
      @Option(names = "op")
      RetentionPolicy o;
    }
    OptionDescriptor i = CommandFactory.DEFAULT.create(A.class).getOption("--op");
    assertEquals(Arrays.asList("op"), i.getNames());

    //
    class B {
      @Option(names = "-o")
      RetentionPolicy o;
View Full Code Here

TOP

Related Classes of org.crsh.cli.descriptor.OptionDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.