Add Javadoc comments to enhance code clarity
[cli-helper.git] / src / main / java / eu / svjatoslav / commons / cli_helper / parameter_parser / parameter / FileOption.java
index 935ea9f..c10ec1e 100755 (executable)
@@ -9,6 +9,10 @@ import eu.svjatoslav.commons.cli_helper.parameter_parser.Option;
 
 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;
@@ -61,11 +65,21 @@ public class FileOption extends Option<File, FileOption> {
         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;