1 package eu.svjatoslav.commons.commandline.parameterparser.parameter;
3 import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
4 import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
6 public class StringParameter extends Parameter {
8 public StringParameter(final String description) {
9 super(description, ArgumentCount.SINGLE);
13 public StringParameter addAliases(final String... aliasArray) {
14 super.addAliases(aliasArray);
18 public String getValue() {
20 if (arguments.size() != 1)
21 throw new RuntimeException("Parameter " + description
22 + " shall have exactly 1 argument.");
24 return arguments.get(0);
28 public StringParameter setMandatory() {
34 public java.lang.String describeFormat() {
39 public boolean validate(final java.lang.String value) {