Add Javadoc comments to enhance code clarity
[cli-helper.git] / src / main / java / eu / svjatoslav / commons / cli_helper / parameter_parser / parameter / DirectoryOptions.java
index 2632174..d012cf9 100755 (executable)
@@ -11,14 +11,32 @@ import java.io.File;
 import java.util.List;
 import java.util.stream.Collectors;
 
+/**
+ * DirectoryOptions class represents a command-line option for one or more directories.
+ */
 public class DirectoryOptions extends Option<List<File>, DirectoryOptions> {
 
+    /**
+     * This enum is used to define if resource denoted by particular option parameter shall exist or not.
+     * <p>
+     * This allows to specify for example if directory shall exist or not.
+     */
     private ExistenceType existenceType = ExistenceType.DOES_NOT_MATTER;
 
+    /**
+     * Creates a new DirectoryOptions object with the given description.
+     *
+     * @param description The description of the directory options.
+     */
     public DirectoryOptions(final String description) {
         super(description, ParameterCount.ONE_OR_MORE);
     }
 
+    /**
+     * Returns a string describing the format of the option.
+     *
+     * @return A string describing the format of the option.
+     */
     @Override
     public String describeFormat() {
         switch (existenceType) {
@@ -31,6 +49,11 @@ public class DirectoryOptions extends Option<List<File>, DirectoryOptions> {
         }
     }
 
+    /**
+     * Returns the value of the option as a list of File objects.
+     *
+     * @return The value of the option as a list of File objects.
+     */
     @Override
     public List<File> getValue() {
         return parameters.stream().map(File::new).collect(Collectors.toList());
@@ -46,6 +69,7 @@ public class DirectoryOptions extends Option<List<File>, DirectoryOptions> {
         return this;
     }
 
+
     @Override
     public boolean isValid(final String value) {
         final File file = new File(value);