import java.io.File;
+/**
+ * This class represents commandline option which accepts exactly one parameter
+ * which is a file.
+ */
public class FileOption extends Option<File, FileOption> {
private ExistenceType existenceType = ExistenceType.DOES_NOT_MATTER;
return new File(parameters.get(0));
}
+ /**
+ * This method sets that file shall exist.
+ *
+ * @return This object.
+ */
public FileOption mustExist() {
existenceType = ExistenceType.MUST_EXIST;
return this;
}
+ /**
+ * This method sets that file shall not exist.
+ *
+ * @return This object.
+ */
public FileOption mustNotExist() {
existenceType = ExistenceType.MUST_NOT_EXIST;
return this;