package seedu.ezdo.logic.parser;

import static seedu.ezdo.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

import java.util.Optional;

import seedu.ezdo.logic.commands.Command;
import seedu.ezdo.logic.commands.DoneCommand;
import seedu.ezdo.logic.commands.IncorrectCommand;


/**
 * Parses input arguments and creates a new DoneCommand object
 */
public class DoneCommandParser {

    /**
     * Parses the given {@code String} of arguments in the context of the DoneCommand
     * and returns an DoneCommand object for execution.
     */
    public Command parse(String args) {

        if (("").equals(args)) {
            return new DoneCommand();
        }

        Optional<Integer> index = ParserUtil.parseIndex(args);
        if (!index.isPresent()) {
            return new IncorrectCommand(
                    String.format(MESSAGE_INVALID_COMMAND_FORMAT, DoneCommand.MESSAGE_USAGE));
        }

        return new DoneCommand(index.get());
    }

}

@@ -124,24 +124,25 @@
 va.util.
-Optional
+ArrayList
 ;%0A%0Aimpor
@@ -675,16 +675,17 @@
     
-Optional
+ArrayList
 %3CInt
@@ -695,16 +695,18 @@
 r%3E index
+es
  = Parse
@@ -721,16 +721,18 @@
 rseIndex
+es
 (args);%0A
@@ -747,24 +747,23 @@
 if (
-!
 index
+es
 .is
-Present
+Empty
 ()) 
@@ -951,14 +951,10 @@
 ndex
-.get()
+es
 );%0A 

Change DoneCommandParser to support multiple indexes