+/*
+ * 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 java.io.File;
import eu.svjatoslav.commons.commandline.parameterparser.ArgumentCount;
import eu.svjatoslav.commons.commandline.parameterparser.Parameter;
-public class DirectoryParameter extends Parameter {
+public class DirectoryParameter extends Parameter<DirectoryParameter> {
private ExistanceType existanceType = ExistanceType.DOES_NOT_MATTER;
super(description, ArgumentCount.SINGLE);
}
- @Override
- public DirectoryParameter addAliases(final String... aliasArray) {
- super.addAliases(aliasArray);
- return this;
- }
-
@Override
public java.lang.String describeFormat() {
return existanceType.description + "directory";
}
+ @Override
public File getValue() {
if (arguments.size() != 1)
return this;
}
- @Override
- public DirectoryParameter setMandatory() {
- mandatory = true;
- return this;
- }
-
@Override
public boolean validate(final java.lang.String value) {
final File file = new File(value);