+/*
+ * Svjatoslav Commons - shared library of common functionality.
+ * Copyright ©2012-2014, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 3 of the GNU Lesser General Public License
+ * or later as published by the Free Software Foundation.
+ */
+
package eu.svjatoslav.commons.commandline.parameterparser.parameter;
import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
-import eu.svjatoslav.commons.commandline.parameterparser.type.StringArgument;
public class StringParameter extends Parameter {
public StringParameter(final String description) {
- super(new StringArgument(), description, ArgumentCount.SINGLE);
+ super(description, ArgumentCount.SINGLE);
}
@Override
return this;
}
+ @Override
+ public java.lang.String describeFormat() {
+ return "string";
+ }
+
public String getValue() {
if (arguments.size() != 1)
return arguments.get(0);
}
+
+ @Override
+ public StringParameter setMandatory() {
+ mandatory = true;
+ return this;
+ }
+
+ @Override
+ public boolean validate(final java.lang.String value) {
+ return true;
+ }
+
}